Add better boolean handling for StaticValue annotation
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-08-16 17:12:27 +02:00
Ursprung 5050580774
Commit b28178b915

Datei anzeigen

@ -138,11 +138,11 @@ public class SWCommandUtils {
if (staticValue.allowISE()) {
if ((parameter.getType() == boolean.class || parameter.getType() == Boolean.class)) {
List<String> tabCompletes = new ArrayList<>(Arrays.asList(staticValue.value()));
Set<Integer> trueValues = new HashSet<>();
for (int i : staticValue.falseValues()) trueValues.add(i);
Set<Integer> falseValues = new HashSet<>();
for (int i : staticValue.falseValues()) falseValues.add(i);
return createMapper(s -> {
int index = tabCompletes.indexOf(s);
return index == -1 ? null : !trueValues.contains(index);
return index == -1 ? null : !falseValues.contains(index);
}, (commandSender, s) -> tabCompletes);
}
if ((parameter.getType() == int.class || parameter.getType() == Integer.class) && staticValue.value().length >= 2) {