mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-01-15 12:01:51 +01:00
Catch and log exceptions during chunk-load on players joining.
This commit is contained in:
parent
0561638105
commit
43b33ed350
@ -5,6 +5,8 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
|
|
||||||
|
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||||
|
import fr.neatmonster.nocheatplus.logging.Streams;
|
||||||
import fr.neatmonster.nocheatplus.utilities.ds.CoordMap;
|
import fr.neatmonster.nocheatplus.utilities.ds.CoordMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,8 +52,14 @@ public abstract class BlockCache {
|
|||||||
for (int cx = minX; cx <= maxX; cx ++) {
|
for (int cx = minX; cx <= maxX; cx ++) {
|
||||||
for (int cz = minZ; cz <= maxZ; cz ++) {
|
for (int cz = minZ; cz <= maxZ; cz ++) {
|
||||||
if (!world.isChunkLoaded(cx, cz)) {
|
if (!world.isChunkLoaded(cx, cz)) {
|
||||||
world.loadChunk(cx, cz);
|
try {
|
||||||
loaded ++;
|
world.loadChunk(cx, cz);
|
||||||
|
loaded ++;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
// (Can't seem to catch more precisely: TileEntity with CB 1.7.10)
|
||||||
|
NCPAPIProvider.getNoCheatPlusAPI().getLogManager().severe(Streams.STATUS, "Failed to load chunk at " + (cx * 16) + "," + (cz * 16) + " (real coordinates):\n" + StringUtil.throwableToString(ex));
|
||||||
|
// (Don't count as loaded.)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user