diff options
author | KHobbits <rob@khobbits.co.uk> | 2013-08-13 00:55:31 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2013-08-13 00:55:31 +0100 |
commit | d329d27a4f00758cc3530a7cc3b0b9a123ea75c6 (patch) | |
tree | 5b03efda8369f720617b2a42ec4a1bbcc6dd57d3 | |
parent | e9c0bd3babe75e702c52d56307e000c9c00a3913 (diff) | |
download | Essentials-d329d27a4f00758cc3530a7cc3b0b9a123ea75c6.tar Essentials-d329d27a4f00758cc3530a7cc3b0b9a123ea75c6.tar.gz Essentials-d329d27a4f00758cc3530a7cc3b0b9a123ea75c6.tar.lz Essentials-d329d27a4f00758cc3530a7cc3b0b9a123ea75c6.tar.xz Essentials-d329d27a4f00758cc3530a7cc3b0b9a123ea75c6.zip |
Restore safe location for /top
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandtop.java | 3 |
1 files changed, 2 insertions, 1 deletions
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")); } |