From ba10b1c06e577a56b4439225b466cf1124f91994 Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 30 Aug 2016 10:22:55 +0100 Subject: [PATCH] Fix removal of temporary nodes --- .../lucko/luckperms/core/PermissionHolder.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java index fc4282179..3b931a24d 100644 --- a/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/core/PermissionHolder.java @@ -284,7 +284,7 @@ public abstract class PermissionHolder { private static Tristate hasPermission(Set toQuery, Node node) { for (Node n : toQuery) { - if (n.equalsIgnoringValue(node)) { + if (n.almostEquals(node)) { return n.getTristate(); } } @@ -425,7 +425,13 @@ public abstract class PermissionHolder { throw new ObjectLacksException(); } - nodes.remove(node); + Iterator iterator = nodes.iterator(); + while (iterator.hasNext()) { + Node entry = iterator.next(); + if (entry.almostEquals(node)) { + iterator.remove(); + } + } if (node.isGroupNode()) { plugin.getApiProvider().fireEventAsync(new GroupRemoveEvent(new PermissionHolderLink(this), @@ -445,7 +451,13 @@ public abstract class PermissionHolder { throw new ObjectLacksException(); } - transientNodes.remove(node); + Iterator iterator = transientNodes.iterator(); + while (iterator.hasNext()) { + Node entry = iterator.next(); + if (entry.almostEquals(node)) { + iterator.remove(); + } + } if (node.isGroupNode()) { plugin.getApiProvider().fireEventAsync(new GroupRemoveEvent(new PermissionHolderLink(this),