From cf0134a5770f256080182a1d8fbbc9fd30575eba Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Tue, 10 Feb 2015 02:20:54 +1300 Subject: [PATCH] Change commandmanager to cancel event if command is registered, despite not having permissions --- .../mineplex/core/command/CommandCenter.java | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java index c96ee9a04..4da7927f9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java @@ -58,19 +58,20 @@ public class CommandCenter implements Listener ICommand command = Commands.get(commandName.toLowerCase()); - if (command != null && ClientManager.Get(event.getPlayer()).GetRank().Has(event.getPlayer(), command.GetRequiredRank(), command.GetSpecificRanks(), true)) + if (command != null) { - if (!Recharge.Instance.use(event.getPlayer(), "Command", 500, false, false)) - { - event.getPlayer().sendMessage(F.main("Command Center", "You can't spam commands that fast.")); - event.setCancelled(true); - return; - } - - command.SetAliasUsed(commandName.toLowerCase()); - command.Execute(event.getPlayer(), args); - - event.setCancelled(true); + if (ClientManager.Get(event.getPlayer()).GetRank().Has(event.getPlayer(), command.GetRequiredRank(), command.GetSpecificRanks(), true)) + { + if (!Recharge.Instance.use(event.getPlayer(), "Command", 500, false, false)) + { + event.getPlayer().sendMessage(F.main("Command Center", "You can't spam commands that fast.")); + return; + } + + command.SetAliasUsed(commandName.toLowerCase()); + command.Execute(event.getPlayer(), args); + } + event.setCancelled(true); } }