From 07f38aa283ea3c52f4d928ec940b7cb8b87aeb74 Mon Sep 17 00:00:00 2001 From: Luck Date: Sun, 5 Mar 2017 22:56:00 +0000 Subject: [PATCH] Fix possible issue with context conversion --- .../java/me/lucko/luckperms/sponge/service/proxy/Util.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/service/proxy/Util.java b/sponge/src/main/java/me/lucko/luckperms/sponge/service/proxy/Util.java index b5a094f1..8012f137 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/service/proxy/Util.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/service/proxy/Util.java @@ -28,6 +28,7 @@ import lombok.experimental.UtilityClass; import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableSet; import me.lucko.luckperms.api.context.ContextSet; import me.lucko.luckperms.api.context.ImmutableContextSet; @@ -44,7 +45,7 @@ public class Util { .build(new CacheLoader, ImmutableContextSet>() { @Override public ImmutableContextSet load(Set contexts) { - return ContextSet.fromEntries(contexts); + return ImmutableContextSet.fromEntries(contexts); } }); @@ -57,7 +58,7 @@ public class Util { }); public static ContextSet convertContexts(@NonNull Set contexts) { - return SPONGE_TO_LP_CACHE.getUnchecked(contexts); + return SPONGE_TO_LP_CACHE.getUnchecked(ImmutableSet.copyOf(contexts)); } public static Set convertContexts(@NonNull ContextSet contexts) {