Backport CommonCore changes from #430

VelocityCore /check command
This commit is contained in:
SteamWar Backport Bot
2026-06-17 19:18:03 +00:00
parent 56fd93a474
commit b8d61da881
2 changed files with 9 additions and 3 deletions
@@ -146,12 +146,12 @@ public final class GameModeConfig<M, W> {
public final List<String> CheckQuestions; public final List<String> CheckQuestions;
/** /**
* The allowed checkers to check this schematic type denoted by a list of SteamWar ids. * The allowed checkers to check this schematic type denoted by a list of SteamwarUser ids.
* The people need the {@link UserPerm#CHECK} to be able to check though. * The people need the {@link UserPerm#CHECK} to be able to check though.
* *
* @implSpec {@code []} by default -> denoting every person with {@link UserPerm#CHECK} can check it * @implSpec {@code []} by default -> denoting every person with {@link UserPerm#CHECK} can check it
*/ */
public final List<Integer> Checkers; public final Set<Integer> Checkers;
/** /**
* Bundle for countdowns during the fight * Bundle for countdowns during the fight
@@ -246,7 +246,7 @@ public final class GameModeConfig<M, W> {
} }
CheckQuestions = loader.getStringList("CheckQuestions"); CheckQuestions = loader.getStringList("CheckQuestions");
Checkers = loader.getIntList("Checkers"); Checkers = loader.getIntSet("Checkers");
Times = new TimesConfig(loader.with("Times")); Times = new TimesConfig(loader.with("Times"));
// Arena would be here to be in config order but needs Schematic.Size and EnterStages loaded afterwards // Arena would be here to be in config order but needs Schematic.Size and EnterStages loaded afterwards
Schematic = new SchematicConfig<>(loader.with("Schematic")); Schematic = new SchematicConfig<>(loader.with("Schematic"));
@@ -139,6 +139,12 @@ final class YMLWrapper<M, W> {
return get(path, o -> (List<Integer>) o); return get(path, o -> (List<Integer>) o);
} }
public Set<Integer> getIntSet(String path) {
List<Integer> list = get(path, o -> (List<Integer>) o);
if (list.isEmpty()) return Collections.emptySet();
return Collections.unmodifiableSet(new HashSet<>(list));
}
public List<SchematicType> getSchematicTypeList(String path) { public List<SchematicType> getSchematicTypeList(String path) {
List<String> list = getStringList(path); List<String> list = getStringList(path);
if (list.isEmpty()) { if (list.isEmpty()) {