forked from SteamWar/SteamWar
Implement CheckCommand for Checkers not having Check perm
This commit is contained in:
@@ -151,7 +151,7 @@ public final class GameModeConfig<M, W> {
|
||||
*
|
||||
* @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
|
||||
@@ -246,7 +246,7 @@ public final class GameModeConfig<M, W> {
|
||||
}
|
||||
|
||||
CheckQuestions = loader.getStringList("CheckQuestions");
|
||||
Checkers = loader.getIntList("Checkers");
|
||||
Checkers = loader.getIntSet("Checkers");
|
||||
Times = new TimesConfig(loader.with("Times"));
|
||||
// Arena would be here to be in config order but needs Schematic.Size and EnterStages loaded afterwards
|
||||
Schematic = new SchematicConfig<>(loader.with("Schematic"));
|
||||
|
||||
@@ -139,6 +139,12 @@ final class YMLWrapper<M, W> {
|
||||
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) {
|
||||
List<String> list = getStringList(path);
|
||||
if (list.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user