summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2013-08-13 00:55:31 +0100
committerKHobbits <rob@khobbits.co.uk>2013-08-13 00:55:31 +0100
commitab0a1e4f64f8478d8ff06c7e0397f812537cfb58 (patch)
tree90dd49edc8765affdf01b7529c83745b8fe85893
parent99d7c2e4c792d6591b351bbeb354f56a8257e2cb (diff)
downloadEssentials-ab0a1e4f64f8478d8ff06c7e0397f812537cfb58.tar
Essentials-ab0a1e4f64f8478d8ff06c7e0397f812537cfb58.tar.gz
Essentials-ab0a1e4f64f8478d8ff06c7e0397f812537cfb58.tar.lz
Essentials-ab0a1e4f64f8478d8ff06c7e0397f812537cfb58.tar.xz
Essentials-ab0a1e4f64f8478d8ff06c7e0397f812537cfb58.zip
Restore safe location for /top
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtop.java3
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"));
}