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();
|
||||
|
||||
while (destination.getBlock().getType() != Material.AIR
|
||||
&& destination.add(0, 1, 0).getBlock().getType() != Material.AIR)
|
||||
destination.setY(256);
|
||||
|
||||
while (destination.getBlock().getType().equals(Material.AIR))
|
||||
{
|
||||
if (destination.getY() > 256)
|
||||
{
|
||||
break;
|
||||
}
|
||||
destination.add(0, -1, 0);
|
||||
}
|
||||
|
||||
_teleportManager.teleportPlayer(player, destination);
|
||||
_teleportManager.teleportPlayer(player, destination.add(0, 1, 0));
|
||||
|
||||
message(player, "You have been teleported to Y = " + C.cYellow + destination.getY());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user