From 13ebc87b29db80b097dbe3ca785811db4666c7e7 Mon Sep 17 00:00:00 2001 From: Luck Date: Wed, 20 May 2020 21:37:07 +0100 Subject: [PATCH] Fix compatibility with modified SimplePluginManager in Mohist fork https://github.com/Mohist-Community/Mohist/blob/eab0f722a48759152f5d562b39689317f647ce99/src/main/java/org/bukkit/plugin/SimplePluginManager.java#L674 --- .../inject/server/LuckPermsSubscriptionMap.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/server/LuckPermsSubscriptionMap.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/server/LuckPermsSubscriptionMap.java index 85a3eedfa..6207e9936 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/server/LuckPermsSubscriptionMap.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/inject/server/LuckPermsSubscriptionMap.java @@ -44,6 +44,7 @@ import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.WeakHashMap; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -121,6 +122,21 @@ public final class LuckPermsSubscriptionMap extends HashMap> m) { + m.forEach(this::put); + } + + @Override + public Map putIfAbsent(String key, Map value) { + return get(key); + } + + @Override + public Map computeIfAbsent(String key, Function> mappingFunction) { + return get(key); + } + // if the key isn't null and is a string, #get will always return a value for it @Override public boolean containsKey(Object key) {