mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-02-21 06:02:35 +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.
|
// General things.
|
||||||
public final boolean tempKickIllegal;
|
public final boolean tempKickIllegal;
|
||||||
|
public final boolean loadChunksOnJoin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new moving configuration.
|
* 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);
|
yStep = config.getDouble(ConfPaths.MOVING_SURVIVALFLY_YSTEP, 0.001, 0.45, 0.1);
|
||||||
|
|
||||||
tempKickIllegal = config.getBoolean(ConfPaths.MOVING_TEMPKICKILLEGAL);
|
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.logging.LogUtil;
|
||||||
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
import fr.neatmonster.nocheatplus.permissions.Permissions;
|
||||||
import fr.neatmonster.nocheatplus.players.DataManager;
|
import fr.neatmonster.nocheatplus.players.DataManager;
|
||||||
|
import fr.neatmonster.nocheatplus.utilities.BlockCache;
|
||||||
import fr.neatmonster.nocheatplus.utilities.BlockProperties;
|
import fr.neatmonster.nocheatplus.utilities.BlockProperties;
|
||||||
import fr.neatmonster.nocheatplus.utilities.CheckUtils;
|
import fr.neatmonster.nocheatplus.utilities.CheckUtils;
|
||||||
import fr.neatmonster.nocheatplus.utilities.PlayerLocation;
|
import fr.neatmonster.nocheatplus.utilities.PlayerLocation;
|
||||||
@ -1236,14 +1237,14 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
data.sfHoverTicks = -1;
|
data.sfHoverTicks = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// // Check loaded chunks.
|
// Check loaded chunks.
|
||||||
// if (cc.loadChunksOnJoin){
|
if (cc.loadChunksOnJoin){
|
||||||
// final int loaded = BlockCache.ensureChunksLoaded(loc.getWorld(), loc.getX(), loc.getZ(), 3.0);
|
final int loaded = BlockCache.ensureChunksLoaded(loc.getWorld(), loc.getX(), loc.getZ(), 3.0);
|
||||||
// if (loaded > 0 && BuildParameters.debugLevel > 0){
|
if (loaded > 0 && BuildParameters.debugLevel > 0){
|
||||||
// // DEBUG
|
// DEBUG
|
||||||
// LogUtil.logInfo("[NoCheatPlus] Player join: Loaded " + loaded + " chunk" + (loaded == 1 ? "" : "s") + " for the world " + loc.getWorld().getName() + " for player: " + player.getName());
|
LogUtil.logInfo("[NoCheatPlus] Player join: Loaded " + loaded + " chunk" + (loaded == 1 ? "" : "s") + " for the world " + loc.getWorld().getName() + " for player: " + player.getName());
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -571,7 +571,9 @@ public abstract class ConfPaths {
|
|||||||
public static final String MOVING_SURVIVALFLY_YSTEP = MOVING_SURVIVALFLY + "ystep";
|
public static final String MOVING_SURVIVALFLY_YSTEP = MOVING_SURVIVALFLY + "ystep";
|
||||||
|
|
||||||
// General.
|
// 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,
|
* dP"8 d8 ,e,
|
||||||
|
@ -446,6 +446,7 @@ public class DefaultConfig extends ConfigFile {
|
|||||||
|
|
||||||
// General.
|
// General.
|
||||||
set(ConfPaths.MOVING_TEMPKICKILLEGAL, true);
|
set(ConfPaths.MOVING_TEMPKICKILLEGAL, true);
|
||||||
|
set(ConfPaths.MOVING_LOADCHUNKS_JOIN, true);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dP"8 d8 ,e,
|
* dP"8 d8 ,e,
|
||||||
|
Loading…
Reference in New Issue
Block a user