From 246d07482bf1bc3a6545e06aae19bd42f5da2a46 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Mon, 19 Dec 2011 16:30:26 +0000 Subject: [PATCH] Fixed world.getHighestBlockYAt(x,z) returning 0 for existing but not loaded chunks. This fixes BUKKIT-327. Thanks for dredhorse for the pull request! --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index d1139422e0..b1ee1cb670 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); }