diff --git a/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java b/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java index 3b65a7bd2..f32e84115 100644 --- a/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java +++ b/common/src/main/java/me/lucko/luckperms/common/config/AbstractConfiguration.java @@ -25,12 +25,11 @@ package me.lucko.luckperms.common.config; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; -import com.google.common.util.concurrent.Futures; -import com.google.common.util.concurrent.ListenableFuture; import me.lucko.luckperms.common.config.keys.EnduringKey; import java.util.Set; +import java.util.stream.Collectors; @SuppressWarnings("unchecked") public abstract class AbstractConfiguration implements LPConfiguration { @@ -40,15 +39,6 @@ public abstract class AbstractConfiguration implements LPConfiguration { public Object load(ConfigKey key) { return key.get(AbstractConfiguration.this); } - - @Override - public ListenableFuture reload(ConfigKey key, Object oldValue) { - if (key instanceof EnduringKey) { - return Futures.immediateFuture(key); - } else { - return Futures.immediateFuture(key.get(AbstractConfiguration.this)); - } - } }); @Override @@ -64,7 +54,10 @@ public abstract class AbstractConfiguration implements LPConfiguration { @Override public void reload() { init(); - Set> keys = cache.asMap().keySet(); - keys.forEach(cache::refresh); + + Set> toInvalidate = cache.asMap().keySet().stream().filter(k -> !(k instanceof EnduringKey)).collect(Collectors.toSet()); + cache.invalidateAll(toInvalidate); + + loadAll(); } } diff --git a/pom.xml b/pom.xml index 339d1da3c..069da0328 100644 --- a/pom.xml +++ b/pom.xml @@ -8,8 +8,8 @@ luckperms 2.17-SNAPSHOT - common api + common bukkit bukkit-legacy bukkit-placeholders