mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-02-15 19:21:34 +01:00
Load chunks on players joining (configurable).
This commit is contained in:
parent
dcd606d1d2
commit
634ca39824
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user