Add Argument.BOOLEAN
Dieser Commit ist enthalten in:
Ursprung
b179eeb5df
Commit
a65ce1c04d
@ -32,7 +32,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public class Argument<T> {
|
||||
|
||||
public static final Argument<Boolean> BOOLEAN = new Argument<>(ArgumentType.BOOLEAN, bool -> true);
|
||||
public static final Argument<Boolean> BOOLEAN = new Argument<>(ArgumentType.BOOLEAN, bool -> true, "true", "false");
|
||||
public static final Argument<Integer> INT = new Argument<>(ArgumentType.INT, integer -> true);
|
||||
public static final Argument<Long> LONG = new Argument<>(ArgumentType.LONG, l -> true);
|
||||
public static final Argument<Float> FLOAT = new Argument<>(ArgumentType.FLOAT, f -> true);
|
||||
@ -49,6 +49,10 @@ public class Argument<T> {
|
||||
this(argumentType, constraint, o -> o, () -> tabCompletes);
|
||||
}
|
||||
|
||||
public Argument(ArgumentType<T> argumentType, Predicate<T> constraint, Supplier<String[]> tabCompletes) {
|
||||
this(argumentType, constraint, o -> o, tabCompletes);
|
||||
}
|
||||
|
||||
public <M> Argument(ArgumentType<T> argumentType, Predicate<T> constraint, Function<T, M> valueMapper, Supplier<String[]> tabCompletes) {
|
||||
this.argumentType = argumentType;
|
||||
this.constraint = constraint;
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren