Renamed CommandArgumentType -> ArgumentType

This commit is contained in:
Nathan Adams 2017-07-10 12:04:52 +02:00
parent c1a159f75a
commit 13a7d53bdc
6 changed files with 14 additions and 14 deletions

View file

@ -5,7 +5,7 @@ import com.mojang.brigadier.exceptions.CommandException;
import java.util.Set; import java.util.Set;
public interface CommandArgumentType<T> { public interface ArgumentType<T> {
<S> ParsedArgument<S, T> parse(String command) throws CommandException; <S> ParsedArgument<S, T> parse(String command) throws CommandException;
void listSuggestions(String command, Set<String> output); void listSuggestions(String command, Set<String> output);

View file

@ -10,7 +10,7 @@ import com.mojang.brigadier.exceptions.ParameterizedCommandExceptionType;
import java.util.Set; import java.util.Set;
public class IntegerArgumentType implements CommandArgumentType<Integer> { public class IntegerArgumentType implements ArgumentType<Integer> {
public static final ParameterizedCommandExceptionType ERROR_NOT_A_NUMBER = new ParameterizedCommandExceptionType("argument.integer.invalid", "Expected an integer, found '${found}'", "found"); 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_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"); public static final ParameterizedCommandExceptionType ERROR_TOO_BIG = new ParameterizedCommandExceptionType("argument.integer.big", "Integer must not be more than ${maximum}, found ${found}", "found", "maximum");

View file

@ -10,7 +10,7 @@ import com.mojang.brigadier.exceptions.SimpleCommandExceptionType;
import java.util.Set; import java.util.Set;
public class StringArgumentType implements CommandArgumentType<String> { public class StringArgumentType implements ArgumentType<String> {
public static final ParameterizedCommandExceptionType ERROR_INVALID_ESCAPE = new ParameterizedCommandExceptionType("argument.string.escape.invalid", "Unknown or invalid escape sequence: ${input}", "input"); 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_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"); 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");

View file

@ -1,19 +1,19 @@
package com.mojang.brigadier.builder; 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.ArgumentCommandNode;
import com.mojang.brigadier.tree.CommandNode; import com.mojang.brigadier.tree.CommandNode;
public class RequiredArgumentBuilder<S, T> extends ArgumentBuilder<S, RequiredArgumentBuilder<S, T>> { public class RequiredArgumentBuilder<S, T> extends ArgumentBuilder<S, RequiredArgumentBuilder<S, T>> {
private final String name; private final String name;
private final CommandArgumentType<T> type; private final ArgumentType<T> type;
private RequiredArgumentBuilder(String name, CommandArgumentType<T> type) { private RequiredArgumentBuilder(String name, ArgumentType<T> type) {
this.name = name; this.name = name;
this.type = type; this.type = type;
} }
public static <S, T> RequiredArgumentBuilder<S, T> argument(String name, CommandArgumentType<T> type) { public static <S, T> RequiredArgumentBuilder<S, T> argument(String name, ArgumentType<T> type) {
return new RequiredArgumentBuilder<>(name, type); return new RequiredArgumentBuilder<>(name, type);
} }
@ -22,7 +22,7 @@ public class RequiredArgumentBuilder<S, T> extends ArgumentBuilder<S, RequiredAr
return this; return this;
} }
public CommandArgumentType<T> getType() { public ArgumentType<T> getType() {
return type; return type;
} }

View file

@ -1,7 +1,7 @@
package com.mojang.brigadier.tree; package com.mojang.brigadier.tree;
import com.mojang.brigadier.Command; 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.builder.RequiredArgumentBuilder;
import com.mojang.brigadier.context.CommandContextBuilder; import com.mojang.brigadier.context.CommandContextBuilder;
import com.mojang.brigadier.context.ParsedArgument; import com.mojang.brigadier.context.ParsedArgument;
@ -15,9 +15,9 @@ public class ArgumentCommandNode<S, T> extends CommandNode<S> {
private static final String USAGE_ARGUMENT_CLOSE = ">"; private static final String USAGE_ARGUMENT_CLOSE = ">";
private final String name; private final String name;
private final CommandArgumentType<T> type; private final ArgumentType<T> type;
public ArgumentCommandNode(String name, CommandArgumentType<T> type, Command<S> command, Predicate<S> requirement) { public ArgumentCommandNode(String name, ArgumentType<T> type, Command<S> command, Predicate<S> requirement) {
super(command, requirement); super(command, requirement);
this.name = name; this.name = name;
this.type = type; this.type = type;
@ -27,7 +27,7 @@ public class ArgumentCommandNode<S, T> extends CommandNode<S> {
return name; return name;
} }
public CommandArgumentType<T> getType() { public ArgumentType<T> getType() {
return type; return type;
} }

View file

@ -1,7 +1,7 @@
package com.mojang.brigadier.builder; package com.mojang.brigadier.builder;
import com.mojang.brigadier.Command; import com.mojang.brigadier.Command;
import com.mojang.brigadier.arguments.CommandArgumentType; import com.mojang.brigadier.arguments.ArgumentType;
import com.mojang.brigadier.tree.ArgumentCommandNode; import com.mojang.brigadier.tree.ArgumentCommandNode;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -15,7 +15,7 @@ import static org.junit.Assert.assertThat;
public class RequiredArgumentBuilderTest { public class RequiredArgumentBuilderTest {
@Mock @Mock
private CommandArgumentType<Integer> type; private ArgumentType<Integer> type;
private RequiredArgumentBuilder<Object, Integer> builder; private RequiredArgumentBuilder<Object, Integer> builder;
@Mock @Mock
private private