summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
diff options
context:
space:
mode:
authorZenexer <Zenexer@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-03-30 04:03:21 +0000
committerZenexer <Zenexer@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-03-30 04:03:21 +0000
commitcb21bc4d7a67f0974c2773fdd0f5376f177c068e (patch)
treef1584fe391f77c648a1d7d25385ef16229b756de /Essentials/src/com/earth2me/essentials/commands/Commandtop.java
downloadEssentials-cb21bc4d7a67f0974c2773fdd0f5376f177c068e.tar
Essentials-cb21bc4d7a67f0974c2773fdd0f5376f177c068e.tar.gz
Essentials-cb21bc4d7a67f0974c2773fdd0f5376f177c068e.tar.lz
Essentials-cb21bc4d7a67f0974c2773fdd0f5376f177c068e.tar.xz
Essentials-cb21bc4d7a67f0974c2773fdd0f5376f177c068e.zip
2.1 prerelease, part 2 of 3
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk2.1@1015 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandtop.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtop.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtop.java b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
new file mode 100644
index 000000000..a928701a2
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtop.java
@@ -0,0 +1,26 @@
+package com.earth2me.essentials.commands;
+
+import org.bukkit.Location;
+import org.bukkit.Server;
+import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.User;
+
+
+public class Commandtop extends EssentialsCommand
+{
+ public Commandtop()
+ {
+ super("top");
+ }
+
+ @Override
+ public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
+ {
+ int topX = user.getLocation().getBlockX();
+ int topZ = user.getLocation().getBlockZ();
+ int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
+ user.charge(this);
+ user.teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), this.getName());
+ user.sendMessage("ยง7Teleporting to top.");
+ }
+}