diff --git a/TheButtonAutoFlair.jar b/TheButtonAutoFlair.jar index 4e1ab4b..9bd8861 100644 Binary files a/TheButtonAutoFlair.jar and b/TheButtonAutoFlair.jar differ diff --git a/TheButtonAutoFlair/plugin.yml b/TheButtonAutoFlair/plugin.yml index 4bcf6f7..f68f6c7 100644 --- a/TheButtonAutoFlair/plugin.yml +++ b/TheButtonAutoFlair/plugin.yml @@ -18,6 +18,7 @@ commands: mwiki: description: Search the wiki. usage: "&vUsage: /mwiki [query]&r" + dontrunthiscmd: author: NorbiPeti depend: [Essentials, Towny, Minigames, Votifier, Factions] permissions: diff --git a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java index 39f144f..730c1ca 100644 --- a/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java +++ b/TheButtonAutoFlair/src/tk/sznp/thebuttonautoflair/PlayerListener.java @@ -645,7 +645,7 @@ public class PlayerListener implements Listener { event.getSender().sendMessage( "§6You are now talking in: §b" + ConsoleChannel.DisplayName); - event.setCancelled(true); + event.setCommand("dontrunthiscmd"); } else if (cmd.equalsIgnoreCase(Channel.AdminChat.Command)) { if (ConsoleChannel.equals(Channel.AdminChat)) ConsoleChannel = Channel.GlobalChat; @@ -654,7 +654,7 @@ public class PlayerListener implements Listener { event.getSender().sendMessage( "§6You are now talking in: §b" + ConsoleChannel.DisplayName); - event.setCancelled(true); + event.setCommand("dontrunthiscmd"); } else if (cmd.equalsIgnoreCase(Channel.ModChat.Command)) { if (ConsoleChannel.equals(Channel.ModChat)) ConsoleChannel = Channel.GlobalChat; @@ -663,50 +663,50 @@ public class PlayerListener implements Listener { event.getSender().sendMessage( "§6You are now talking in: §b" + ConsoleChannel.DisplayName); - event.setCancelled(true); + event.setCommand("dontrunthiscmd"); } } else { cmd = event.getCommand().substring(0, index); if (cmd.equalsIgnoreCase(Channel.GlobalChat.Command)) { - event.setCancelled(true); Channel c = ConsoleChannel; ConsoleChannel = Channel.GlobalChat; ChatProcessing.ProcessChat(Bukkit.getServer() .getConsoleSender(), event.getCommand().substring(index + 1)); ConsoleChannel = c; + event.setCommand("dontrunthiscmd"); } else if (cmd.equalsIgnoreCase(Channel.TownChat.Command)) { - event.setCancelled(true); Channel c = ConsoleChannel; ConsoleChannel = Channel.TownChat; ChatProcessing.ProcessChat(Bukkit.getServer() .getConsoleSender(), event.getCommand().substring(index + 1)); ConsoleChannel = c; + event.setCommand("dontrunthiscmd"); } else if (cmd.equalsIgnoreCase(Channel.NationChat.Command)) { - event.setCancelled(true); Channel c = ConsoleChannel; ConsoleChannel = Channel.NationChat; ChatProcessing.ProcessChat(Bukkit.getServer() .getConsoleSender(), event.getCommand().substring(index + 1)); ConsoleChannel = c; + event.setCommand("dontrunthiscmd"); } else if (cmd.equalsIgnoreCase(Channel.AdminChat.Command)) { - event.setCancelled(true); Channel c = ConsoleChannel; ConsoleChannel = Channel.AdminChat; ChatProcessing.ProcessChat(Bukkit.getServer() .getConsoleSender(), event.getCommand().substring(index + 1)); ConsoleChannel = c; + event.setCommand("dontrunthiscmd"); } else if (cmd.equalsIgnoreCase(Channel.ModChat.Command)) { - event.setCancelled(true); Channel c = ConsoleChannel; ConsoleChannel = Channel.ModChat; ChatProcessing.ProcessChat(Bukkit.getServer() .getConsoleSender(), event.getCommand().substring(index + 1)); ConsoleChannel = c; + event.setCommand("dontrunthiscmd"); } } if (cmd.toLowerCase().startsWith("un")) { @@ -722,7 +722,7 @@ public class PlayerListener implements Listener { if (target == null) { event.getSender().sendMessage( "§cError: Player not found. (/un" + s + " )"); - event.setCancelled(true); + event.setCommand("dontrunthiscmd"); } if (target != null) { target.addPotionEffect(new PotionEffect( @@ -735,7 +735,7 @@ public class PlayerListener implements Listener { .sendMessage( event.getSender().getName() + " un" + s + "'d " + target.getDisplayName()); - event.setCancelled(true); + event.setCommand("dontrunthiscmd"); } } } diff --git a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class index b72418b..f9d91d2 100644 Binary files a/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class and b/TheButtonAutoFlair/target/classes/tk/sznp/thebuttonautoflair/PlayerListener.class differ