From d329d27a4f00758cc3530a7cc3b0b9a123ea75c6 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Tue, 13 Aug 2013 00:55:31 +0100 Subject: [PATCH] Restore safe location for /top --- .../src/com/earth2me/essentials/commands/Commandtop.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java index 89c5c6f8f..4909cb059 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java @@ -3,6 +3,7 @@ package com.earth2me.essentials.commands; import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.Trade; import com.earth2me.essentials.User; +import com.earth2me.essentials.utils.LocationUtil; import org.bukkit.Location; import org.bukkit.Server; import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause; @@ -22,7 +23,7 @@ public class Commandtop extends EssentialsCommand final int topZ = user.getLocation().getBlockZ(); final float pitch = user.getLocation().getPitch(); final float yaw = user.getLocation().getYaw(); - final Location location = new Location(user.getWorld(), topX, user.getWorld().getMaxHeight(), topZ, yaw, pitch); + final Location location = LocationUtil.getSafeDestination(new Location(user.getWorld(), topX, user.getWorld().getMaxHeight(), topZ, yaw, pitch)); user.getTeleport().teleport(location, new Trade(this.getName(), ess), TeleportCause.COMMAND); user.sendMessage(_("teleportTop")); }