diff --git a/src/de/craftinc/gates/commands/BaseCommand.java b/src/de/craftinc/gates/commands/BaseCommand.java index 4e8ab05..1dde1e4 100644 --- a/src/de/craftinc/gates/commands/BaseCommand.java +++ b/src/de/craftinc/gates/commands/BaseCommand.java @@ -75,7 +75,7 @@ public abstract class BaseCommand protected boolean validateCall() { - boolean allParamtertersThere = parameters.size() < requiredParameters.size(); + boolean allParamtertersThere = parameters.size() >= requiredParameters.size(); boolean senderIsPlayer = this.sender instanceof Player; boolean parameterIsGate = this.parameters.size() > 0 ? this.getGateForParamater(this.parameters.get(0)) : false; boolean senderHasPermission; @@ -103,17 +103,18 @@ public abstract class BaseCommand return false; } + if (!allParamtertersThere) + { + sendMessage("Usage: " + this.getUseageTemplate(true)); + return false; + } + + if (this.hasGateParam && !parameterIsGate) { sendMessage(ChatColor.RED + "There exists no gate with id " + this.parameters.get(0)); return false; } - - if (allParamtertersThere) - { - sendMessage("Usage: " + this.getUseageTemplate(true)); - return false; - } return true; }