From 5ed2190cb354925389aebdac925acc5e9a673542 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 30 Sep 2016 23:32:49 +1000 Subject: [PATCH] Fixes #1369 --- .../java/com/plotsquared/bukkit/util/BukkitUtil.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java index 14d8156bd..b5f3e9c6e 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -178,7 +178,14 @@ public class BukkitUtil extends WorldUtil { @Override public int getHighestBlock(String world, int x, int z) { - return getWorld(world).getHighestBlockAt(x, z).getY(); + World bukkitWorld = getWorld(world); + for (int y = bukkitWorld.getMaxHeight() - 1; y > 0; y--) { + Block block = bukkitWorld.getBlockAt(x, y, z); + if (block != null && block.getType().isSolid()) { + return y+1; + } + } + return 0; } @Override