Add new debug-chunk-loads setting

This commit is contained in:
fullwall 2020-12-24 19:03:21 +08:00
parent aa136420c8
commit b9e6418d52
2 changed files with 10 additions and 0 deletions

View File

@ -156,6 +156,9 @@ public class EventListen implements Listener {
respawnAllFromCoord(coord, event);
}
};
if (Messaging.isDebugging() && Setting.DEBUG_CHUNK_LOADS.asBoolean()) {
new Exception().printStackTrace();
}
if (event instanceof Cancellable) {
runnable.run();
} else {
@ -196,7 +199,13 @@ public class EventListen implements Listener {
Messaging.debug("Despawned id", npc.getId(), "due to chunk unload at", coord);
}
}
if (Messaging.isDebugging() && Setting.DEBUG_CHUNK_LOADS.asBoolean()) {
new Exception().printStackTrace();
}
if (loadChunk) {
if (Messaging.isDebugging()) {
Messaging.debug("Loading chunk in 10 ticks due to forced chunk load at", coord);
}
Bukkit.getScheduler().scheduleSyncDelayedTask(CitizensAPI.getPlugin(), new Runnable() {
@Override
public void run() {

View File

@ -72,6 +72,7 @@ public class Settings {
CHAT_RANGE("npc.chat.options.range", 5),
CHECK_MINECRAFT_VERSION("advanced.check-minecraft-version", true),
CONTROLLABLE_GROUND_DIRECTION_MODIFIER("npc.controllable.ground-direction-modifier", 1.0D),
DEBUG_CHUNK_LOADS("general.debug-chunk-loads", false),
DEBUG_FILE("general.debug-file", ""),
DEBUG_MODE("general.debug-mode", false),
DEBUG_PATHFINDING("general.debug-pathfinding", false),