diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java index cce1477b..6f3c2a66 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingConfig.java @@ -127,6 +127,7 @@ public class MovingConfig extends ACheckConfig { // General things. public final boolean tempKickIllegal; + public final boolean loadChunksOnJoin; /** * Instantiates a new moving configuration. @@ -196,6 +197,7 @@ public class MovingConfig extends ACheckConfig { yStep = config.getDouble(ConfPaths.MOVING_SURVIVALFLY_YSTEP, 0.001, 0.45, 0.1); tempKickIllegal = config.getBoolean(ConfPaths.MOVING_TEMPKICKILLEGAL); + loadChunksOnJoin = config.getBoolean(ConfPaths.MOVING_LOADCHUNKS_JOIN); } diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java index 64533d77..d4f9309a 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/checks/moving/MovingListener.java @@ -58,6 +58,7 @@ import fr.neatmonster.nocheatplus.logging.DebugUtil; import fr.neatmonster.nocheatplus.logging.LogUtil; import fr.neatmonster.nocheatplus.permissions.Permissions; import fr.neatmonster.nocheatplus.players.DataManager; +import fr.neatmonster.nocheatplus.utilities.BlockCache; import fr.neatmonster.nocheatplus.utilities.BlockProperties; import fr.neatmonster.nocheatplus.utilities.CheckUtils; import fr.neatmonster.nocheatplus.utilities.PlayerLocation; @@ -1236,14 +1237,14 @@ public class MovingListener extends CheckListener implements TickListener, IRemo data.sfHoverTicks = -1; } -// // Check loaded chunks. -// if (cc.loadChunksOnJoin){ -// final int loaded = BlockCache.ensureChunksLoaded(loc.getWorld(), loc.getX(), loc.getZ(), 3.0); -// if (loaded > 0 && BuildParameters.debugLevel > 0){ -// // DEBUG -// LogUtil.logInfo("[NoCheatPlus] Player join: Loaded " + loaded + " chunk" + (loaded == 1 ? "" : "s") + " for the world " + loc.getWorld().getName() + " for player: " + player.getName()); -// } -// } + // Check loaded chunks. + if (cc.loadChunksOnJoin){ + final int loaded = BlockCache.ensureChunksLoaded(loc.getWorld(), loc.getX(), loc.getZ(), 3.0); + if (loaded > 0 && BuildParameters.debugLevel > 0){ + // DEBUG + LogUtil.logInfo("[NoCheatPlus] Player join: Loaded " + loaded + " chunk" + (loaded == 1 ? "" : "s") + " for the world " + loc.getWorld().getName() + " for player: " + player.getName()); + } + } } diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java index f50c5320..33f9a684 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/ConfPaths.java @@ -571,8 +571,10 @@ public abstract class ConfPaths { public static final String MOVING_SURVIVALFLY_YSTEP = MOVING_SURVIVALFLY + "ystep"; // General. - public static final String MOVING_TEMPKICKILLEGAL = MOVING + "tempkickillegal"; - + public static final String MOVING_TEMPKICKILLEGAL = MOVING + "tempkickillegal"; + private static final String MOVING_LOADCHUNKS = MOVING + "loadchunks."; + public static final String MOVING_LOADCHUNKS_JOIN = MOVING_LOADCHUNKS + "join"; + /* * dP"8 d8 ,e, * C8b Y d88 888,8, " 888 8e e88 888 dP"Y diff --git a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java index 5e73211a..307e1189 100644 --- a/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java +++ b/NCPPlugin/src/main/java/fr/neatmonster/nocheatplus/config/DefaultConfig.java @@ -446,6 +446,7 @@ public class DefaultConfig extends ConfigFile { // General. set(ConfPaths.MOVING_TEMPKICKILLEGAL, true); + set(ConfPaths.MOVING_LOADCHUNKS_JOIN, true); /* * dP"8 d8 ,e,