Fix for Issue #14.

This commit is contained in:
Tobias Ottenweller 2013-02-20 14:32:37 +01:00
parent c79a856907
commit 26927d35c2

View File

@ -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;
}