From a68f4fd65c791fa9dd882d28d721386d1f98c429 Mon Sep 17 00:00:00 2001 From: Spencer Date: Sat, 30 Dec 2017 20:13:32 -0500 Subject: [PATCH] Fix top command only teleporting to the next air gap --- .../mapparser/command/teleport/TopCommand.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; } }