From 62917a0355cf10039d5771fa52a74669514f8deb Mon Sep 17 00:00:00 2001 From: Brianna Date: Wed, 16 Oct 2019 13:12:30 -0400 Subject: [PATCH] Choose highest limit perm. --- .../com/songoda/epicfarming/listeners/BlockListeners.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/epicfarming/listeners/BlockListeners.java b/src/main/java/com/songoda/epicfarming/listeners/BlockListeners.java index 69fc847..fdd15c4 100644 --- a/src/main/java/com/songoda/epicfarming/listeners/BlockListeners.java +++ b/src/main/java/com/songoda/epicfarming/listeners/BlockListeners.java @@ -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; }