summaryrefslogtreecommitdiffstats
path: root/Essentials/src/net/ess3/commands/Commandtop.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/net/ess3/commands/Commandtop.java')
-rw-r--r--Essentials/src/net/ess3/commands/Commandtop.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/Essentials/src/net/ess3/commands/Commandtop.java b/Essentials/src/net/ess3/commands/Commandtop.java
new file mode 100644
index 000000000..3298f8acd
--- /dev/null
+++ b/Essentials/src/net/ess3/commands/Commandtop.java
@@ -0,0 +1,21 @@
+package net.ess3.commands;
+
+import static net.ess3.I18n._;
+import net.ess3.economy.Trade;
+import net.ess3.api.IUser;
+import org.bukkit.Location;
+import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
+
+
+public class Commandtop extends EssentialsCommand
+{
+ @Override
+ public void run(final IUser user, final String commandLabel, final String[] args) throws Exception
+ {
+ final int topX = user.getLocation().getBlockX();
+ final int topZ = user.getLocation().getBlockZ();
+ final int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
+ user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), new Trade(commandName, ess), TeleportCause.COMMAND);
+ user.sendMessage(_("teleportTop"));
+ }
+}