Choose highest limit perm.

This commit is contained in:
Brianna 2019-10-16 13:12:30 -04:00
parent 67e907be5c
commit 62917a0355

View File

@ -58,7 +58,9 @@ public class BlockListeners implements Listener {
int limit = -1;
for (PermissionAttachmentInfo permissionAttachmentInfo : player.getEffectivePermissions()) {
if (!permissionAttachmentInfo.getPermission().toLowerCase().startsWith("epicfarming.limit")) continue;
limit = Integer.parseInt(permissionAttachmentInfo.getPermission().split("\\.")[2]);
int num = Integer.parseInt(permissionAttachmentInfo.getPermission().split("\\.")[2]);
if (num > limit)
limit = num;
}
return limit;
}