Load chunks on players joining (configurable).

This commit is contained in:
asofold 2013-04-27 00:32:07 +02:00
parent dcd606d1d2
commit 634ca39824
4 changed files with 16 additions and 10 deletions

View File

@ -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);
}

View File

@ -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());
}
}
}

View File

@ -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

View File

@ -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,