Fix CommandPart Validator for varargs part
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful
Dieser Commit ist enthalten in:
Ursprung
43728d8143
Commit
c4ed8948ad
@ -26,7 +26,6 @@ import java.lang.annotation.Annotation;
|
|||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.lang.reflect.Parameter;
|
import java.lang.reflect.Parameter;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.BiConsumer;
|
|
||||||
import java.util.function.BiFunction;
|
import java.util.function.BiFunction;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -189,7 +188,7 @@ public class SWCommandUtils {
|
|||||||
AbstractSWCommand.ErrorMessage errorMessage = parameter.getAnnotation(AbstractSWCommand.ErrorMessage.class);
|
AbstractSWCommand.ErrorMessage errorMessage = parameter.getAnnotation(AbstractSWCommand.ErrorMessage.class);
|
||||||
if (errorMessage != null) {
|
if (errorMessage != null) {
|
||||||
return (AbstractValidator<T, String>) (sender, value, messageSender) -> {
|
return (AbstractValidator<T, String>) (sender, value, messageSender) -> {
|
||||||
if (value == null) messageSender.accept(errorMessage.value(), new Object[0]);
|
if (value == null) messageSender.send(errorMessage.value(), new Object[0]);
|
||||||
return value != null;
|
return value != null;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren