diff options
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandtppos.java')
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandtppos.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java new file mode 100644 index 000000000..031735e9a --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java @@ -0,0 +1,42 @@ +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 Commandtppos extends EssentialsCommand +{ + public Commandtppos() + { + super("tppos"); + } + + @Override + public String[] getTriggers() + { + return new String[] + { + getName(), "tpp" + }; + } + + @Override + public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception + { + if (args.length < 3) + { + user.sendMessage("§cUsage: /tppos [x] [y] [z]"); + return; + } + int x = Integer.parseInt(args[0]); + int y = Integer.parseInt(args[1]); + int z = Integer.parseInt(args[2]); + Location l = new Location(user.getWorld(),x,y,z); + user.canAfford(this); + user.teleportCooldown(); + user.sendMessage("§7Teleporting..."); + user.teleport(user.getSafeDestination(l), this.getName()); + } +}
\ No newline at end of file |