mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 03:25:19 +01:00
Ensure immutability of QueryOptions options map
This commit is contained in:
parent
bb3afa21a4
commit
bca766c20d
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
package me.lucko.luckperms.common.query;
|
package me.lucko.luckperms.common.query;
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableMap;
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
|
||||||
import net.luckperms.api.context.ContextSet;
|
import net.luckperms.api.context.ContextSet;
|
||||||
@ -45,7 +46,7 @@ public class QueryOptionsImpl implements QueryOptions {
|
|||||||
private final QueryMode mode;
|
private final QueryMode mode;
|
||||||
private final ImmutableContextSet context;
|
private final ImmutableContextSet context;
|
||||||
private final byte flags;
|
private final byte flags;
|
||||||
private final Map<OptionKey<?>, Object> options;
|
private final ImmutableMap<OptionKey<?>, Object> options;
|
||||||
private final int hashCode;
|
private final int hashCode;
|
||||||
|
|
||||||
private Set<Flag> flagsSet = null;
|
private Set<Flag> flagsSet = null;
|
||||||
@ -54,7 +55,7 @@ public class QueryOptionsImpl implements QueryOptions {
|
|||||||
this.mode = mode;
|
this.mode = mode;
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.flags = flags;
|
this.flags = flags;
|
||||||
this.options = options;
|
this.options = ImmutableMap.copyOf(options);
|
||||||
this.hashCode = calculateHashCode();
|
this.hashCode = calculateHashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user