From 4810eb0ac41bc4cc71aa573219ab4c2159464f73 Mon Sep 17 00:00:00 2001 From: Shevchik Date: Mon, 16 Dec 2013 10:21:41 +0400 Subject: [PATCH] Fix command restrict --- src/com/cnaude/chairs/CommandRestrict.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/com/cnaude/chairs/CommandRestrict.java b/src/com/cnaude/chairs/CommandRestrict.java index 49ae2c5..510e3b3 100644 --- a/src/com/cnaude/chairs/CommandRestrict.java +++ b/src/com/cnaude/chairs/CommandRestrict.java @@ -20,13 +20,14 @@ public class CommandRestrict implements Listener { String playercommand = event.getMessage().toLowerCase(); if (plugin.sit.containsKey(player.getName())) { + if (plugin.sitDisableAllCommands) + { + event.setCancelled(true); + player.sendMessage(plugin.msgCommandRestricted); + return; + } for (String disabledCommand : plugin.sitDisabledCommands) { - if (plugin.sitDisableAllCommands) - { - event.setCancelled(true); - player.sendMessage(plugin.msgCommandRestricted); - } else if (disabledCommand.startsWith(playercommand)) { String therest = disabledCommand.replace(playercommand, ""); @@ -34,6 +35,7 @@ public class CommandRestrict implements Listener { { event.setCancelled(true); player.sendMessage(plugin.msgCommandRestricted); + return; } } }