From 77b06acad4faa9d1614fd02387c40a412b37fb97 Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 6 Dec 2016 21:53:57 +0000 Subject: [PATCH] declare child states --- .../luckperms/common/core/model/PermissionHolder.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java b/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java index eb461157..373e632e 100644 --- a/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java +++ b/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java @@ -173,9 +173,7 @@ public abstract class PermissionHolder { mergedCache.invalidate(); // Invalidate inheritance caches - getAllNodesCache.invalidateAll(); - getAllNodesFilteredCache.invalidateAll(); - exportNodesCache.invalidateAll(); + invalidateInheritanceCaches(); // Get previous references Set refs = plugin.getCachedStateManager().getInheritances(toReference()); @@ -190,6 +188,13 @@ public abstract class PermissionHolder { CachedStateManager.invalidateInheritances(plugin, refs); } + public void invalidateInheritanceCaches() { + getAllNodesCache.invalidateAll(); + getAllNodesFilteredCache.invalidateAll(); + exportNodesCache.invalidateAll(); + declareState(); + } + private ImmutableSortedSet cacheApply() { TreeSet combined = new TreeSet<>(PriorityComparator.reverse()); Set enduring = getNodes();