Package net.minecraft.commands.arguments
Class OperationArgument
java.lang.Object
net.minecraft.commands.arguments.OperationArgument
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<OperationArgument.Operation>
public class OperationArgument
extends Object
implements com.mojang.brigadier.arguments.ArgumentType<OperationArgument.Operation>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface(package private) static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final Collection<String> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic OperationArgument.OperationgetOperation(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) private static OperationArgument.OperationgetOperation(String pName) Makes anOperationArgument.Operationinstance based on the given name.private static OperationArgument.SimpleOperationgetSimpleOperation(String pName) Makes anOperationArgument.Operationinstance based on the given name.<S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) static OperationArgumentparse(com.mojang.brigadier.StringReader pReader) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mojang.brigadier.arguments.ArgumentType
parse
-
Field Details
-
EXAMPLES
-
ERROR_INVALID_OPERATION
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INVALID_OPERATION -
ERROR_DIVIDE_BY_ZERO
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_DIVIDE_BY_ZERO
-
-
Constructor Details
-
OperationArgument
public OperationArgument()
-
-
Method Details
-
operation
-
getOperation
public static OperationArgument.Operation getOperation(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName) -
parse
public OperationArgument.Operation parse(com.mojang.brigadier.StringReader pReader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parsein interfacecom.mojang.brigadier.arguments.ArgumentType<OperationArgument.Operation>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listSuggestions
public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> pContext, com.mojang.brigadier.suggestion.SuggestionsBuilder pBuilder) - Specified by:
listSuggestionsin interfacecom.mojang.brigadier.arguments.ArgumentType<OperationArgument.Operation>
-
getExamples
- Specified by:
getExamplesin interfacecom.mojang.brigadier.arguments.ArgumentType<OperationArgument.Operation>
-
getOperation
private static OperationArgument.Operation getOperation(String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException Makes anOperationArgument.Operationinstance based on the given name. This method handles all operations.- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getSimpleOperation
private static OperationArgument.SimpleOperation getSimpleOperation(String pName) throws com.mojang.brigadier.exceptions.CommandSyntaxException Makes anOperationArgument.Operationinstance based on the given name. This method actually returnsOperationArgument.SimpleOperation, which is used as a functional interface target with 2 ints. It handles all operations other than swap (>invalid input: '<').- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-