From e06ee55259b3549a59358a13c095a274bacf6a05 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sat, 30 Dec 2023 14:24:46 -0500 Subject: testing new version --- .../java/net/benjidial/nswp/commands/DenyTPA.java | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/main/java/net/benjidial/nswp/commands/DenyTPA.java (limited to 'src/main/java/net/benjidial/nswp/commands/DenyTPA.java') diff --git a/src/main/java/net/benjidial/nswp/commands/DenyTPA.java b/src/main/java/net/benjidial/nswp/commands/DenyTPA.java new file mode 100644 index 0000000..43077ab --- /dev/null +++ b/src/main/java/net/benjidial/nswp/commands/DenyTPA.java @@ -0,0 +1,32 @@ +package net.benjidial.nswp.commands; + +import net.benjidial.nswp.Database; + +import org.bukkit.entity.Player; + +import java.sql.SQLException; +import java.util.List; + +public class DenyTPA extends PlayerCommand { + + public List getTabCompletions(Player sender, String[] args) throws SQLException { + return filterByArg(Database.getTPAAllowedTo(sender), args, 0); + } + + public boolean doCommand(Player sender, String[] args) throws SQLException { + + if (args.length != 1) + return false; + + int removed = Database.disallowTPA(args[0], sender); + + if (removed == 0) + sender.sendMessage("Did not find anyone allowed to teleport to you with the name " + args[0] + "."); + else + sender.sendMessage(args[0] + " is no longer allowed to teleport to you."); + + return true; + + } + +} -- cgit v1.2.3