Fixed index out of bounds exception.

This commit is contained in:
Tobias Ottenweller 2013-02-10 03:56:00 +01:00
parent 58695cadd3
commit 59a7f4f80e

View File

@ -82,7 +82,7 @@ public abstract class BaseCommand
{ {
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.getGateForParamater(this.parameters.get(0)); boolean parameterIsGate = this.parameters.size() > 0 ? this.getGateForParamater(this.parameters.get(0)) : false;
boolean senderHasPermission; boolean senderHasPermission;
try { try {
@ -188,6 +188,11 @@ public abstract class BaseCommand
throw new Exception("Cannot check permissons with no gate provided!"); throw new Exception("Cannot check permissons with no gate provided!");
} }
System.out.println("************");
System.out.println(this.gate.getLocation().getWorld());
System.out.println(this.gate.getExit().getWorld());
System.out.println("************");
boolean permAtLocation = Plugin.permission.has(this.gate.getLocation().getWorld(), player.getName(), this.requiredPermission); boolean permAtLocation = Plugin.permission.has(this.gate.getLocation().getWorld(), player.getName(), this.requiredPermission);
boolean permAtExit = Plugin.permission.has(this.gate.getExit().getWorld(), player.getName(), this.requiredPermission); boolean permAtExit = Plugin.permission.has(this.gate.getExit().getWorld(), player.getName(), this.requiredPermission);