Fix validators
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2022-08-22 21:06:10 +02:00
Ursprung 384605c7ce
Commit 3701f6f5ff
3 geänderte Dateien mit 6 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -182,10 +182,10 @@ class CommandPart<T> {
})) { })) {
return new CheckArgumentResult(false, null); return new CheckArgumentResult(false, null);
} }
}
return new CheckArgumentResult(value != null, value); return new CheckArgumentResult(value != null, value);
}
} catch (Exception e) { } catch (Exception e) {
}
return new CheckArgumentResult(false, null); return new CheckArgumentResult(false, null);
} }
}
} }

Datei anzeigen

@ -75,7 +75,7 @@ public class SubCommand<T> {
if (!validator.validate(sender, sender, (s, objectArgs) -> { if (!validator.validate(sender, sender, (s, objectArgs) -> {
abstractSWCommand.sendMessage(sender, s, objectArgs); abstractSWCommand.sendMessage(sender, s, objectArgs);
})) { })) {
throw new CommandNoHelpException(); return false;
} }
} }
method.setAccessible(true); method.setAccessible(true);
@ -87,7 +87,7 @@ public class SubCommand<T> {
if (!validator.validate(sender, sender, (s, objectArgs) -> { if (!validator.validate(sender, sender, (s, objectArgs) -> {
abstractSWCommand.sendMessage(sender, s, objectArgs); abstractSWCommand.sendMessage(sender, s, objectArgs);
})) { })) {
throw new CommandNoHelpException(); return false;
} }
} }
objects.add(0, senderFunction.apply(sender)); objects.add(0, senderFunction.apply(sender));

Datei anzeigen

@ -43,11 +43,13 @@ public class ValidatorCommand extends TestSWCommand {
@Register @Register
public void onError(String sender, @ErrorMessage("Hello World") int error) { public void onError(String sender, @ErrorMessage("Hello World") int error) {
System.out.println("onError: " + sender + " " + error);
throw new ExecutionIdentifier("RunOnError"); throw new ExecutionIdentifier("RunOnError");
} }
@Register @Register
public void onError(String sender, double error) { public void onError(String sender, double error) {
System.out.println("onError: " + sender + " " + error);
throw new ExecutionIdentifier("RunOnErrorDouble"); throw new ExecutionIdentifier("RunOnErrorDouble");
} }