Fix for Issue #14.
This commit is contained in:
parent
c79a856907
commit
26927d35c2
@ -75,7 +75,7 @@ public abstract class BaseCommand
|
|||||||
|
|
||||||
protected boolean validateCall()
|
protected boolean validateCall()
|
||||||
{
|
{
|
||||||
boolean allParamtertersThere = parameters.size() < requiredParameters.size();
|
boolean allParamtertersThere = parameters.size() >= requiredParameters.size();
|
||||||
boolean senderIsPlayer = this.sender instanceof Player;
|
boolean senderIsPlayer = this.sender instanceof Player;
|
||||||
boolean parameterIsGate = this.parameters.size() > 0 ? this.getGateForParamater(this.parameters.get(0)) : false;
|
boolean parameterIsGate = this.parameters.size() > 0 ? this.getGateForParamater(this.parameters.get(0)) : false;
|
||||||
boolean senderHasPermission;
|
boolean senderHasPermission;
|
||||||
@ -103,17 +103,18 @@ public abstract class BaseCommand
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!allParamtertersThere)
|
||||||
|
{
|
||||||
|
sendMessage("Usage: " + this.getUseageTemplate(true));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (this.hasGateParam && !parameterIsGate)
|
if (this.hasGateParam && !parameterIsGate)
|
||||||
{
|
{
|
||||||
sendMessage(ChatColor.RED + "There exists no gate with id " + this.parameters.get(0));
|
sendMessage(ChatColor.RED + "There exists no gate with id " + this.parameters.get(0));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allParamtertersThere)
|
|
||||||
{
|
|
||||||
sendMessage("Usage: " + this.getUseageTemplate(true));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user