diff --git a/api/src/main/java/me/lucko/luckperms/api/context/ImmutableContextSet.java b/api/src/main/java/me/lucko/luckperms/api/context/ImmutableContextSet.java index c6495b04..ff851df0 100644 --- a/api/src/main/java/me/lucko/luckperms/api/context/ImmutableContextSet.java +++ b/api/src/main/java/me/lucko/luckperms/api/context/ImmutableContextSet.java @@ -30,7 +30,6 @@ import com.google.common.collect.Multimap; import java.util.Collection; import java.util.Map; import java.util.Set; -import java.util.stream.Collectors; /** * An immutable implementation of {@link ContextSet}. @@ -71,13 +70,12 @@ public final class ImmutableContextSet implements ContextSet { throw new NullPointerException("map"); } - return new ImmutableContextSet(ImmutableMultimap.copyOf( - map.entrySet().stream() - .collect(Collectors.toMap( - e -> e.getKey().toLowerCase(), - Map.Entry::getValue - )).entrySet() - )); + ImmutableMultimap.Builder b = ImmutableMultimap.builder(); + for (Map.Entry e : map.entrySet()) { + b.put(e.getKey(), e.getValue()); + } + + return new ImmutableContextSet(b.build()); } /** @@ -160,7 +158,12 @@ public final class ImmutableContextSet implements ContextSet { @Override public Map toMap() { - return ImmutableMap.copyOf(map.entries()); + ImmutableMap.Builder m = ImmutableMap.builder(); + for (Map.Entry e : map.entries()) { + m.put(e.getKey(), e.getValue()); + } + + return m.build(); } @Override diff --git a/api/src/main/java/me/lucko/luckperms/api/context/MutableContextSet.java b/api/src/main/java/me/lucko/luckperms/api/context/MutableContextSet.java index a7a51f2c..de4674c5 100644 --- a/api/src/main/java/me/lucko/luckperms/api/context/MutableContextSet.java +++ b/api/src/main/java/me/lucko/luckperms/api/context/MutableContextSet.java @@ -168,7 +168,12 @@ public final class MutableContextSet implements ContextSet { @Override public Map toMap() { - return ImmutableMap.copyOf(map.entries()); + ImmutableMap.Builder m = ImmutableMap.builder(); + for (Map.Entry e : map.entries()) { + m.put(e.getKey(), e.getValue()); + } + + return m.build(); } @Override