mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-22 08:25:12 +00:00

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1021 e251c2fe-e539-e718-e476-b85c1f46cddb
42 lines
No EOL
933 B
Java
42 lines
No EOL
933 B
Java
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.teleportTo(user.getSafeDestination(l), this.getName());
|
|
}
|
|
} |