diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TopCommand.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TopCommand.java index eae3ceb40..ccf6f6687 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TopCommand.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/command/teleport/TopCommand.java @@ -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; } }