diff --git a/src/main/java/com/mojang/brigadier/arguments/CommandArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/ArgumentType.java similarity index 88% rename from src/main/java/com/mojang/brigadier/arguments/CommandArgumentType.java rename to src/main/java/com/mojang/brigadier/arguments/ArgumentType.java index 61be7ba..71cd23e 100644 --- a/src/main/java/com/mojang/brigadier/arguments/CommandArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/ArgumentType.java @@ -5,7 +5,7 @@ import com.mojang.brigadier.exceptions.CommandException; import java.util.Set; -public interface CommandArgumentType { +public interface ArgumentType { ParsedArgument parse(String command) throws CommandException; void listSuggestions(String command, Set output); diff --git a/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java index 684b43d..eb9740c 100644 --- a/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java @@ -10,7 +10,7 @@ import com.mojang.brigadier.exceptions.ParameterizedCommandExceptionType; import java.util.Set; -public class IntegerArgumentType implements CommandArgumentType { +public class IntegerArgumentType implements ArgumentType { public static final ParameterizedCommandExceptionType ERROR_NOT_A_NUMBER = new ParameterizedCommandExceptionType("argument.integer.invalid", "Expected an integer, found '${found}'", "found"); public static final ParameterizedCommandExceptionType ERROR_TOO_SMALL = new ParameterizedCommandExceptionType("argument.integer.low", "Integer must not be less than ${minimum}, found ${found}", "found", "minimum"); public static final ParameterizedCommandExceptionType ERROR_TOO_BIG = new ParameterizedCommandExceptionType("argument.integer.big", "Integer must not be more than ${maximum}, found ${found}", "found", "maximum"); diff --git a/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java index 7aee66c..92f6b50 100644 --- a/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/StringArgumentType.java @@ -10,7 +10,7 @@ import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; import java.util.Set; -public class StringArgumentType implements CommandArgumentType { +public class StringArgumentType implements ArgumentType { public static final ParameterizedCommandExceptionType ERROR_INVALID_ESCAPE = new ParameterizedCommandExceptionType("argument.string.escape.invalid", "Unknown or invalid escape sequence: ${input}", "input"); public static final SimpleCommandExceptionType ERROR_UNEXPECTED_ESCAPE = new SimpleCommandExceptionType("argument.string.escape.unexpected", "Unexpected escape sequence, please quote the whole argument"); public static final SimpleCommandExceptionType ERROR_UNEXPECTED_START_OF_QUOTE = new SimpleCommandExceptionType("argument.string.quote.unexpected_start", "Unexpected start-of-quote character (\"), please quote the whole argument"); diff --git a/src/main/java/com/mojang/brigadier/builder/RequiredArgumentBuilder.java b/src/main/java/com/mojang/brigadier/builder/RequiredArgumentBuilder.java index 8c8721d..c43bbfa 100644 --- a/src/main/java/com/mojang/brigadier/builder/RequiredArgumentBuilder.java +++ b/src/main/java/com/mojang/brigadier/builder/RequiredArgumentBuilder.java @@ -1,19 +1,19 @@ package com.mojang.brigadier.builder; -import com.mojang.brigadier.arguments.CommandArgumentType; +import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.tree.ArgumentCommandNode; import com.mojang.brigadier.tree.CommandNode; public class RequiredArgumentBuilder extends ArgumentBuilder> { private final String name; - private final CommandArgumentType type; + private final ArgumentType type; - private RequiredArgumentBuilder(String name, CommandArgumentType type) { + private RequiredArgumentBuilder(String name, ArgumentType type) { this.name = name; this.type = type; } - public static RequiredArgumentBuilder argument(String name, CommandArgumentType type) { + public static RequiredArgumentBuilder argument(String name, ArgumentType type) { return new RequiredArgumentBuilder<>(name, type); } @@ -22,7 +22,7 @@ public class RequiredArgumentBuilder extends ArgumentBuilder getType() { + public ArgumentType getType() { return type; } diff --git a/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java b/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java index ce1ab63..76ff3f9 100644 --- a/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/ArgumentCommandNode.java @@ -1,7 +1,7 @@ package com.mojang.brigadier.tree; import com.mojang.brigadier.Command; -import com.mojang.brigadier.arguments.CommandArgumentType; +import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.builder.RequiredArgumentBuilder; import com.mojang.brigadier.context.CommandContextBuilder; import com.mojang.brigadier.context.ParsedArgument; @@ -15,9 +15,9 @@ public class ArgumentCommandNode extends CommandNode { private static final String USAGE_ARGUMENT_CLOSE = ">"; private final String name; - private final CommandArgumentType type; + private final ArgumentType type; - public ArgumentCommandNode(String name, CommandArgumentType type, Command command, Predicate requirement) { + public ArgumentCommandNode(String name, ArgumentType type, Command command, Predicate requirement) { super(command, requirement); this.name = name; this.type = type; @@ -27,7 +27,7 @@ public class ArgumentCommandNode extends CommandNode { return name; } - public CommandArgumentType getType() { + public ArgumentType getType() { return type; } diff --git a/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java b/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java index 11d2b69..9601406 100644 --- a/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java +++ b/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java @@ -1,7 +1,7 @@ package com.mojang.brigadier.builder; import com.mojang.brigadier.Command; -import com.mojang.brigadier.arguments.CommandArgumentType; +import com.mojang.brigadier.arguments.ArgumentType; import com.mojang.brigadier.tree.ArgumentCommandNode; import org.junit.Before; import org.junit.Test; @@ -15,7 +15,7 @@ import static org.junit.Assert.assertThat; public class RequiredArgumentBuilderTest { @Mock - private CommandArgumentType type; + private ArgumentType type; private RequiredArgumentBuilder builder; @Mock private