mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-07-22 21:43:41 +00:00
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:
commit
cb21bc4d7a
237 changed files with 28831 additions and 0 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue