mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-14 02:34:07 +00:00
Fix various runtime errors
This commit is contained in:
34 files changed
+266
-61
No files matched your search
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* This file is part of luckperms, licensed under the MIT License.
|
||||
* This file is part of LuckPerms, licensed under the MIT License.
|
||||
*
|
||||
* Copyright (c) lucko (Luck) <luck@lucko.me>
|
||||
* Copyright (c) contributors
|
||||
|
||||
@@ -37,9 +37,28 @@ final class DefaultQueryOptions {
|
||||
throw new AssertionError();
|
||||
}
|
||||
|
||||
private static boolean setup = false;
|
||||
private static final EnumSet<Flag> DEFAULT_FLAGS = EnumSet.allOf(Flag.class);
|
||||
private static QueryOptions contextual;
|
||||
private static QueryOptions nonContextual;
|
||||
|
||||
static final QueryOptions CONTEXTUAL = QueryOptions.contextual(ImmutableContextSet.empty(), DEFAULT_FLAGS);
|
||||
static final QueryOptions NON_CONTEXTUAL = QueryOptions.nonContextual(DEFAULT_FLAGS);
|
||||
private static void setup() {
|
||||
if (setup) {
|
||||
return;
|
||||
}
|
||||
setup = true;
|
||||
contextual = QueryOptions.contextual(ImmutableContextSet.empty(), DEFAULT_FLAGS);
|
||||
nonContextual = QueryOptions.nonContextual(DEFAULT_FLAGS);
|
||||
}
|
||||
|
||||
static QueryOptions contextual() {
|
||||
setup();
|
||||
return contextual;
|
||||
}
|
||||
|
||||
static QueryOptions nonContextual() {
|
||||
setup();
|
||||
return nonContextual;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -94,7 +94,7 @@ public interface QueryOptions {
|
||||
* @return the default non contextual query options
|
||||
*/
|
||||
static @NonNull QueryOptions nonContextual() {
|
||||
return DefaultQueryOptions.NON_CONTEXTUAL;
|
||||
return DefaultQueryOptions.nonContextual();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ public interface QueryOptions {
|
||||
* @return the default contextual query options
|
||||
*/
|
||||
static @NonNull QueryOptions defaultContextualOptions() {
|
||||
return DefaultQueryOptions.CONTEXTUAL;
|
||||
return DefaultQueryOptions.contextual();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user