Dieser Commit ist enthalten in:
yoyosource 2022-06-16 17:28:14 +02:00
Ursprung d0150a2335
Commit 10525d2a5c
2 geänderte Dateien mit 0 neuen und 25 gelöschten Zeilen

Datei anzeigen

@ -123,30 +123,6 @@ class CommandPart<T> {
} }
} }
public boolean validate(T sender, List<Object> values, int startIndex) {
if (varArgType != null) {
for (int i = startIndex; i < values.size(); i++) {
Object value = values.get(i);
if (validator != null && !validator.validate(sender, value, (s, objects) -> command.sendMessage(sender, s, objects))) {
return false;
}
}
return true;
}
Object value = values.get(startIndex);
if (validator != null && !validator.validate(sender, value, (s, objects) -> command.sendMessage(sender, s, objects))) {
if (optional != null && next != null) {
return next.validate(sender, values, startIndex);
}
return false;
}
if (next != null) {
return next.validate(sender, values, startIndex + 1);
}
return true;
}
public boolean guardCheck(T sender, String[] args, int startIndex) { public boolean guardCheck(T sender, String[] args, int startIndex) {
if (varArgType != null) { if (varArgType != null) {
for (int i = startIndex; i < args.length; i++) { for (int i = startIndex; i < args.length; i++) {

Datei anzeigen

@ -114,7 +114,6 @@ public class SubCommand<T> {
return true; return true;
} }
} }
commandPart.validate(sender, objects, 0);
commandPart.guardCheck(sender, args, 0); commandPart.guardCheck(sender, args, 0);
objects.add(0, senderFunction.apply(sender)); objects.add(0, senderFunction.apply(sender));
method.setAccessible(true); method.setAccessible(true);