Fix stuff
Dieser Commit ist enthalten in:
Ursprung
d0150a2335
Commit
10525d2a5c
@ -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++) {
|
||||||
|
@ -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);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren