diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 65b92006b0..530dd9c83e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -333,6 +333,8 @@ public class CraftWorld implements World { @Override public Chunk getChunkAt(Block block) { + Preconditions.checkArgument(block != null, "null block"); + return getChunkAt(block.getX() >> 4, block.getZ() >> 4); } @@ -471,11 +473,15 @@ public class CraftWorld implements World { @Override public boolean isChunkLoaded(Chunk chunk) { + Preconditions.checkArgument(chunk != null, "null chunk"); + return isChunkLoaded(chunk.getX(), chunk.getZ()); } @Override public void loadChunk(Chunk chunk) { + Preconditions.checkArgument(chunk != null, "null chunk"); + loadChunk(chunk.getX(), chunk.getZ()); ((CraftChunk) getChunkAt(chunk.getX(), chunk.getZ())).getHandle().bukkitChunk = chunk; }