From a65ce1c04d3809fccd104cee18a1d11aba693793 Mon Sep 17 00:00:00 2001 From: jojo Date: Tue, 29 Dec 2020 09:47:34 +0100 Subject: [PATCH] Add Argument.BOOLEAN --- SpigotCore_Main/src/de/steamwar/command/Argument.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SpigotCore_Main/src/de/steamwar/command/Argument.java b/SpigotCore_Main/src/de/steamwar/command/Argument.java index d8de47b..51403a8 100644 --- a/SpigotCore_Main/src/de/steamwar/command/Argument.java +++ b/SpigotCore_Main/src/de/steamwar/command/Argument.java @@ -32,7 +32,7 @@ import java.util.stream.Collectors; public class Argument { - public static final Argument BOOLEAN = new Argument<>(ArgumentType.BOOLEAN, bool -> true); + public static final Argument BOOLEAN = new Argument<>(ArgumentType.BOOLEAN, bool -> true, "true", "false"); public static final Argument INT = new Argument<>(ArgumentType.INT, integer -> true); public static final Argument LONG = new Argument<>(ArgumentType.LONG, l -> true); public static final Argument FLOAT = new Argument<>(ArgumentType.FLOAT, f -> true); @@ -49,6 +49,10 @@ public class Argument { this(argumentType, constraint, o -> o, () -> tabCompletes); } + public Argument(ArgumentType argumentType, Predicate constraint, Supplier tabCompletes) { + this(argumentType, constraint, o -> o, tabCompletes); + } + public Argument(ArgumentType argumentType, Predicate constraint, Function valueMapper, Supplier tabCompletes) { this.argumentType = argumentType; this.constraint = constraint;