Fix top command only teleporting to the next air gap
This commit is contained in:
parent
dfc6e12682
commit
a68f4fd65c
|
@ -23,17 +23,17 @@ public class TopCommand extends BaseCommand
|
||||||
{
|
{
|
||||||
Location destination = player.getLocation().clone();
|
Location destination = player.getLocation().clone();
|
||||||
|
|
||||||
while (destination.getBlock().getType() != Material.AIR
|
destination.setY(256);
|
||||||
&& destination.add(0, 1, 0).getBlock().getType() != Material.AIR)
|
|
||||||
|
while (destination.getBlock().getType().equals(Material.AIR))
|
||||||
{
|
{
|
||||||
if (destination.getY() > 256)
|
destination.add(0, -1, 0);
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_teleportManager.teleportPlayer(player, destination);
|
_teleportManager.teleportPlayer(player, destination.add(0, 1, 0));
|
||||||
|
|
||||||
message(player, "You have been teleported to Y = " + C.cYellow + destination.getY());
|
message(player, "You have been teleported to Y = " + C.cYellow + destination.getY());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue