summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-12-19 16:30:26 +0000
committerNathan Adams <dinnerbone@dinnerbone.com>2011-12-19 16:30:26 +0000
commit246d07482bf1bc3a6545e06aae19bd42f5da2a46 (patch)
tree03ca71d8a73b876ba50c16d84a88236b5bfab465 /src
parentbea7b1373e4e834cc518459db27d1c778a151829 (diff)
downloadcraftbukkit-246d07482bf1bc3a6545e06aae19bd42f5da2a46.tar
craftbukkit-246d07482bf1bc3a6545e06aae19bd42f5da2a46.tar.gz
craftbukkit-246d07482bf1bc3a6545e06aae19bd42f5da2a46.tar.lz
craftbukkit-246d07482bf1bc3a6545e06aae19bd42f5da2a46.tar.xz
craftbukkit-246d07482bf1bc3a6545e06aae19bd42f5da2a46.zip
Fixed world.getHighestBlockYAt(x,z) returning 0 for existing but not loaded chunks. This fixes BUKKIT-327. Thanks for dredhorse for the pull request!
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftWorld.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index d1139422..b1ee1cb6 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -74,6 +74,10 @@ public class CraftWorld implements World {
}
public int getHighestBlockYAt(int x, int z) {
+ if (!isChunkLoaded(x >> 4, z >> 4)){
+ loadChunk(x >> 4, z >> 4);
+ }
+
return world.getHighestBlockYAt(x, z);
}