SteamWar/SpigotCore
Archiviert
13
0

Add Argument.BOOLEAN

Dieser Commit ist enthalten in:
jojo 2020-12-29 09:47:34 +01:00
Ursprung b179eeb5df
Commit a65ce1c04d

Datei anzeigen

@ -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;