forked from LogBlock/LogBlock
Fix world height during safe teleport
This commit is contained in:
@ -734,11 +734,11 @@ public class BukkitUtils {
|
|||||||
final int x = loc.getBlockX(), z = loc.getBlockZ();
|
final int x = loc.getBlockX(), z = loc.getBlockZ();
|
||||||
int y = loc.getBlockY();
|
int y = loc.getBlockY();
|
||||||
boolean lower = world.getBlockAt(x, y, z).isEmpty(), upper = world.getBlockAt(x, y + 1, z).isEmpty();
|
boolean lower = world.getBlockAt(x, y, z).isEmpty(), upper = world.getBlockAt(x, y + 1, z).isEmpty();
|
||||||
while ((!lower || !upper) && y != 127) {
|
while ((!lower || !upper) && y != world.getMaxHeight()) {
|
||||||
lower = upper;
|
lower = upper;
|
||||||
upper = world.getBlockAt(x, ++y, z).isEmpty();
|
upper = world.getBlockAt(x, ++y, z).isEmpty();
|
||||||
}
|
}
|
||||||
while (world.getBlockAt(x, y - 1, z).isEmpty() && y != 0) {
|
while (world.getBlockAt(x, y - 1, z).isEmpty() && y != world.getMinHeight()) {
|
||||||
y--;
|
y--;
|
||||||
}
|
}
|
||||||
return y;
|
return y;
|
||||||
|
Reference in New Issue
Block a user