summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
new file mode 100644
index 000000000..6ed5fc8dc
--- /dev/null
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
@@ -0,0 +1,37 @@
+package com.earth2me.essentials.commands;
+
+import org.bukkit.Server;
+import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.User;
+
+
+public class Commandtpdeny extends EssentialsCommand
+{
+ public Commandtpdeny()
+ {
+ super("tpdeny");
+ }
+
+ @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.charge(this);
+ user.sendMessage("§7Teleport request denied.");
+ p.sendMessage("§7Teleport request denied.");
+ parent.tpcHere.remove(user);
+ }
+ else
+ {
+ user.charge(this);
+ user.sendMessage("§7Teleport request denied.");
+ p.sendMessage("§7Teleport request denied.");
+ parent.tpcRequests.remove(user);
+ }
+ }
+}