diff --git a/src/main/java/com/mojang/brigadier/arguments/ArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/ArgumentType.java index 640e84f..63acbcf 100644 --- a/src/main/java/com/mojang/brigadier/arguments/ArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/ArgumentType.java @@ -16,7 +16,4 @@ public interface ArgumentType { return null; } - default String getUsageText() { - return null; - } } diff --git a/src/main/java/com/mojang/brigadier/arguments/BoolArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/BoolArgumentType.java index 93d2726..be79ea9 100644 --- a/src/main/java/com/mojang/brigadier/arguments/BoolArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/BoolArgumentType.java @@ -21,9 +21,4 @@ public class BoolArgumentType implements ArgumentType { public Boolean parse(final StringReader reader, final CommandContextBuilder contextBuilder) throws CommandSyntaxException { return reader.readBoolean(); } - - @Override - public String getUsageText() { - return "bool"; - } } diff --git a/src/main/java/com/mojang/brigadier/arguments/FloatArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/FloatArgumentType.java index 4e4723d..2bb9fee 100644 --- a/src/main/java/com/mojang/brigadier/arguments/FloatArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/FloatArgumentType.java @@ -95,9 +95,4 @@ public class FloatArgumentType implements ArgumentType { public String getUsageSuffix() { return suffix.length() == 0 ? null : suffix; } - - @Override - public String getUsageText() { - return "float"; - } } diff --git a/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java index 068e4d3..a2f2ae4 100644 --- a/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java @@ -95,9 +95,4 @@ public class IntegerArgumentType implements ArgumentType { public String getUsageSuffix() { return suffix.length() == 0 ? null : suffix; } - - @Override - public String getUsageText() { - return "int"; - } } diff --git a/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java index 78d45fe..fe427a5 100644 --- a/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java @@ -69,11 +69,6 @@ public class StringArgumentType implements ArgumentType { return result.toString(); } - @Override - public String getUsageText() { - return "string"; - } - public enum StringType { SINGLE_WORD, QUOTABLE_PHRASE, diff --git a/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java b/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java index 8e2bb79..cbe5531 100644 --- a/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java @@ -43,11 +43,7 @@ public class ArgumentCommandNode extends CommandNode { @Override public String getUsageText() { - String usage = name; - if (type.getUsageText() != null) { - usage += ": " + type.getUsageText(); - } - usage = USAGE_ARGUMENT_OPEN + usage + USAGE_ARGUMENT_CLOSE; + String usage = USAGE_ARGUMENT_OPEN + name + USAGE_ARGUMENT_CLOSE; if (type.getUsageSuffix() != null) { usage += type.getUsageSuffix(); } diff --git a/src/test/java/com/mojang/brigadier/arguments/BoolArgumentTypeTest.java b/src/test/java/com/mojang/brigadier/arguments/BoolArgumentTypeTest.java index 8a781ea..7b0cfae 100644 --- a/src/test/java/com/mojang/brigadier/arguments/BoolArgumentTypeTest.java +++ b/src/test/java/com/mojang/brigadier/arguments/BoolArgumentTypeTest.java @@ -34,9 +34,4 @@ public class BoolArgumentTypeTest { assertThat(type.parse(reader, context), is(true)); verify(reader).readBoolean(); } - - @Test - public void usageText() throws Exception { - assertThat(type.getUsageText(), equalTo("bool")); - } } \ No newline at end of file diff --git a/src/test/java/com/mojang/brigadier/arguments/FloatArgumentTypeTest.java b/src/test/java/com/mojang/brigadier/arguments/FloatArgumentTypeTest.java index e1507aa..800bdad 100644 --- a/src/test/java/com/mojang/brigadier/arguments/FloatArgumentTypeTest.java +++ b/src/test/java/com/mojang/brigadier/arguments/FloatArgumentTypeTest.java @@ -137,14 +137,4 @@ public class FloatArgumentTypeTest { public void testUsageSuffix_suffix() throws Exception { assertThat(floatArg(0, 100, "L").getUsageSuffix(), equalTo("L")); } - - @Test - public void testUsageText() throws Exception { - assertThat(floatArg().getUsageText(), equalTo("float")); - } - - @Test - public void testUsageText_suffix() throws Exception { - assertThat(floatArg(0, 100, "L").getUsageText(), equalTo("float")); - } } \ No newline at end of file diff --git a/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java b/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java index 6672aca..0eacba3 100644 --- a/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java +++ b/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java @@ -137,14 +137,4 @@ public class IntegerArgumentTypeTest { public void testUsageSuffix_suffix() throws Exception { assertThat(integer(0, 100, "L").getUsageSuffix(), equalTo("L")); } - - @Test - public void testUsageText() throws Exception { - assertThat(integer().getUsageText(), equalTo("int")); - } - - @Test - public void testUsageText_suffix() throws Exception { - assertThat(integer(0, 100, "L").getUsageText(), equalTo("int")); - } } \ No newline at end of file diff --git a/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java index ffe9e07..d4efd60 100644 --- a/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java @@ -48,21 +48,13 @@ public class ArgumentCommandNodeTest extends AbstractCommandNodeTest { @Test public void testUsage() throws Exception { - assertThat(node.getUsageText(), is("")); + assertThat(node.getUsageText(), is("")); } @Test public void testUsage_suffix() throws Exception { node = argument("foo", integer(0, 100, "L")).build(); - assertThat(node.getUsageText(), is("L")); - } - - @Test - public void testUsage_empty() throws Exception { - @SuppressWarnings("unchecked") final ArgumentType type = mock(ArgumentType.class); - when(type.getUsageText()).thenReturn(null); - final ArgumentCommandNode node = argument("foo", type).build(); - assertThat(node.getUsageText(), is("")); + assertThat(node.getUsageText(), is("L")); } @Test