mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-13 12:38:58 +00:00
![snowleo](/assets/img/avatar_default.png)
user.canAfford(String), user.canAfford(EssentialsCommand), user.charge(String), user.charge(EssentialsCommand) have been removed. Teleport class has been changed to use the Charge class. This also fixes some bugs, like the one with warp signs. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1512 e251c2fe-e539-e718-e476-b85c1f46cddb
34 lines
835 B
Java
34 lines
835 B
Java
package com.earth2me.essentials.commands;
|
|
|
|
import org.bukkit.Server;
|
|
import com.earth2me.essentials.User;
|
|
import com.earth2me.essentials.Util;
|
|
|
|
|
|
public class Commandtpahere extends EssentialsCommand
|
|
{
|
|
public Commandtpahere()
|
|
{
|
|
super("tpahere");
|
|
}
|
|
|
|
@Override
|
|
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
|
{
|
|
if (args.length < 1)
|
|
{
|
|
throw new NotEnoughArgumentsException();
|
|
}
|
|
|
|
User p = getPlayer(server, args, 0);
|
|
if (!p.isTeleportEnabled())
|
|
{
|
|
throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
|
|
}
|
|
charge(user);
|
|
p.requestTeleport(user, true);
|
|
p.sendMessage(Util.format("teleportHereRequest", user.getDisplayName()));
|
|
p.sendMessage(Util.i18n("typeTpaccept"));
|
|
user.sendMessage(Util.format("requestSent", p.getDisplayName()));
|
|
}
|
|
}
|