Check all the permissions before coming to conclusions

This commit is contained in:
Fabrizio La Rosa 2020-06-18 14:53:02 +02:00
parent 9d9fb48f0f
commit 7c0460bd06

View File

@ -158,7 +158,7 @@ public class PermissionManager {
Method handler = wrapper.getHandler(); Method handler = wrapper.getHandler();
if (handler.getParameterTypes()[0] != cancellable.getClass()) continue; if (handler.getParameterTypes()[0] != cancellable.getClass()) continue;
if (cancellable.isCancelled()) return false; // if (cancellable.isCancelled()) return false;
if (cancellable instanceof Stoppable && ((Stoppable) cancellable).isStopped()) return true; if (cancellable instanceof Stoppable && ((Stoppable) cancellable).isStopped()) return true;
BasicPermission permission = wrapper.getPermission(); BasicPermission permission = wrapper.getPermission();
@ -172,7 +172,7 @@ public class PermissionManager {
e.printStackTrace(); e.printStackTrace();
} }
} }
return true; return cancellable.isCancelled();
} }
public boolean hasPermission(Player player, Island island, BasicPermission permission, boolean reversePermission){ public boolean hasPermission(Player player, Island island, BasicPermission permission, boolean reversePermission){