Ignore searching top block for teleportation

This commit is contained in:
Jesse Boyd 2017-06-09 17:43:46 +10:00
parent 2b1905889c
commit 355e16fe92
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -172,7 +172,8 @@ public class BukkitUtil extends WorldUtil {
@Override @Override
public int getHighestBlock(String world, int x, int z) { public int getHighestBlock(String world, int x, int z) {
World bukkitWorld = getWorld(world); 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); Block block = bukkitWorld.getBlockAt(x, y, z);
if (block != null) { if (block != null) {
Material type = block.getType(); Material type = block.getType();
@ -189,7 +190,7 @@ public class BukkitUtil extends WorldUtil {
} }
} }
} }
return 0; return bukkitWorld.getMaxHeight();
} }
@Override @Override