mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-21 05:44:33 +00:00
Add a couple of method null checks to CraftWorld
This commit is contained in:
parent
ce66f6937b
commit
a8ec1d60f3
1 changed files with 6 additions and 0 deletions
|
@ -333,6 +333,8 @@ public class CraftWorld implements World {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Chunk getChunkAt(Block block) {
|
public Chunk getChunkAt(Block block) {
|
||||||
|
Preconditions.checkArgument(block != null, "null block");
|
||||||
|
|
||||||
return getChunkAt(block.getX() >> 4, block.getZ() >> 4);
|
return getChunkAt(block.getX() >> 4, block.getZ() >> 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -471,11 +473,15 @@ public class CraftWorld implements World {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isChunkLoaded(Chunk chunk) {
|
public boolean isChunkLoaded(Chunk chunk) {
|
||||||
|
Preconditions.checkArgument(chunk != null, "null chunk");
|
||||||
|
|
||||||
return isChunkLoaded(chunk.getX(), chunk.getZ());
|
return isChunkLoaded(chunk.getX(), chunk.getZ());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadChunk(Chunk chunk) {
|
public void loadChunk(Chunk chunk) {
|
||||||
|
Preconditions.checkArgument(chunk != null, "null chunk");
|
||||||
|
|
||||||
loadChunk(chunk.getX(), chunk.getZ());
|
loadChunk(chunk.getX(), chunk.getZ());
|
||||||
((CraftChunk) getChunkAt(chunk.getX(), chunk.getZ())).getHandle().bukkitChunk = chunk;
|
((CraftChunk) getChunkAt(chunk.getX(), chunk.getZ())).getHandle().bukkitChunk = chunk;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue