From 7b0fe96b1328cd6a209d912e2d6270856b8e7818 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 9 Jul 2019 21:43:32 +0200 Subject: [PATCH] Denying watchcat command --- src/de/steamwar/bungeecore/BungeeCore.java | 1 + .../bungeecore/commands/DenyCommand.java | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 src/de/steamwar/bungeecore/commands/DenyCommand.java diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index 7fa23fc4..934e516b 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -110,6 +110,7 @@ public class BungeeCore extends Plugin { addCmd(new FightCommand()); addCmd(new HelpCommand()); addCmd(new BanCommand()); + addCmd(new DenyCommand("watchcat", "wc")); BroadCastMsgs = config.getStringList("broadcasts").toArray(new String[1]); getProxy().getScheduler().schedule(this, () -> { diff --git a/src/de/steamwar/bungeecore/commands/DenyCommand.java b/src/de/steamwar/bungeecore/commands/DenyCommand.java new file mode 100644 index 00000000..b8f5d845 --- /dev/null +++ b/src/de/steamwar/bungeecore/commands/DenyCommand.java @@ -0,0 +1,21 @@ +package de.steamwar.bungeecore.commands; + +import de.steamwar.bungeecore.BungeeCore; +import net.md_5.bungee.api.CommandSender; +import net.md_5.bungee.api.chat.TextComponent; +import net.md_5.bungee.api.connection.ProxiedPlayer; + +public class DenyCommand extends Command { + + public DenyCommand(String cmd, String ...aliases) { + super(cmd, "", aliases); + } + + @Override + public void execute(CommandSender sender, String[] args) { + if(sender instanceof ProxiedPlayer){ + ProxiedPlayer player = (ProxiedPlayer) sender; + player.sendMessage(new TextComponent(BungeeCore.ChatPrefix + "§cUnbekannter Befehl.")); + } + } +} \ No newline at end of file