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
This commit is contained in:
Zenexer 2011-03-30 04:03:21 +00:00
commit cb21bc4d7a
237 changed files with 28831 additions and 0 deletions

View file

@ -0,0 +1,40 @@
package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.commands.EssentialsCommand;
public class Commandtpaccept extends EssentialsCommand
{
public Commandtpaccept()
{
super("tpaccept");
}
@Override
public void run(Server server, Essentials parent, User user, String commandLabel, String[] args) throws Exception
{
User p = parent.tpcRequests.get(user);
if (p == null) throw new Exception("You do not have a pending request.");
parent.tpcRequests.remove(user);
if (parent.tpcHere.get(user))
{
user.teleportCooldown();
user.canAfford(this);
user.sendMessage("§7Teleport request accepted.");
p.sendMessage("§7Teleport request accepted.");
user.teleport(p, this.getName());
}
else
{
user.canAfford(this);
user.sendMessage("§7Teleport request accepted.");
p.sendMessage("§7Teleport request accepted.");
p.teleport(user, this.getName());
}
}
}