From 355e16fe923180dfeeceff087e2900758b668c83 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Fri, 9 Jun 2017 17:43:46 +1000 Subject: [PATCH] Ignore searching top block for teleportation --- .../main/java/com/plotsquared/bukkit/util/BukkitUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 0ce12e618..14fc9e2fe 100644 --- a/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java +++ b/Bukkit/src/main/java/com/plotsquared/bukkit/util/BukkitUtil.java @@ -172,7 +172,8 @@ public class BukkitUtil extends WorldUtil { @Override public int getHighestBlock(String world, int x, int z) { World bukkitWorld = getWorld(world); - for (int y = bukkitWorld.getMaxHeight() - 1; y > 0; y--) { + // Skip top and bottom block + for (int y = bukkitWorld.getMaxHeight() - 2; y > 0; y--) { Block block = bukkitWorld.getBlockAt(x, y, z); if (block != null) { Material type = block.getType(); @@ -189,7 +190,7 @@ public class BukkitUtil extends WorldUtil { } } } - return 0; + return bukkitWorld.getMaxHeight(); } @Override