Class VanillaArgumentParsers
java.lang.Object
org.incendo.cloud.minecraft.modded.parser.VanillaArgumentParsers
Parsers for Vanilla command argument types.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull ParserDescriptor<C, Coordinates.BlockCoordinates> A parser for block coordinates.static <C> @NonNull ParserDescriptor<C, Coordinates.ColumnCoordinates> A parser for column coordinates.static <C,V> @NonNull ParserDescriptor <C, V> contextualParser(@NonNull Function<net.minecraft.commands.CommandBuildContext, com.mojang.brigadier.arguments.ArgumentType<V>> factory, @NonNull Class<V> valueType) A parser that wraps Brigadier argument types which need aCommandBuildContextstatic booleanisClientSource(net.minecraft.commands.SharedSuggestionProvider sharedSuggestionProvider) Checks whether a source is from client commands.static <C> @NonNull ParserDescriptor<C, net.minecraft.commands.arguments.item.ItemInput> A parser forItemInput.static <C> @NonNull ParserDescriptor<C, Message> A parser forMessage.static <C> @NonNull ParserDescriptor<C, MultipleEntitySelector> A parser forMultipleEntitySelector.static <C> @NonNull ParserDescriptor<C, MultiplePlayerSelector> A parser forMultiplePlayerSelector.static <C> @NonNull ParserDescriptor<C, SingleEntitySelector> A parser forSingleEntitySelector.static <C> @NonNull ParserDescriptor<C, SinglePlayerSelector> A parser forSinglePlayerSelector.static <C> @NonNull ParserDescriptor<C, MinecraftTime> A parser for in-game time, in ticks.static <C> @NonNull ParserDescriptor<C, Coordinates.CoordinatesXZ> vec2Parser(boolean centerIntegers) A parser for coordinates, relative or absolute, from 2 doubles for x and z, with y always defaulting to 0.static <C> @NonNull ParserDescriptor<C, Coordinates> vec3Parser(boolean centerIntegers) A parser for coordinates, relative or absolute, from 3 doubles.
-
Method Details
-
contextualParser
public static <C,V> @NonNull ParserDescriptor<C,V> contextualParser(@NonNull Function<net.minecraft.commands.CommandBuildContext, com.mojang.brigadier.arguments.ArgumentType<V>> factory, @NonNull Class<V> valueType) A parser that wraps Brigadier argument types which need aCommandBuildContext- Type Parameters:
C- sender typeV- argument value type- Parameters:
factory- factory that creates these argumentsvalueType- value type of parsers output- Returns:
- the parser
-
itemInput
public static <C> @NonNull ParserDescriptor<C, net.minecraft.commands.arguments.item.ItemInput> itemInput()A parser forItemInput.- Type Parameters:
C- command sender type- Returns:
- the parser
-
timeParser
A parser for in-game time, in ticks.- Type Parameters:
C- sender type- Returns:
- a parser descriptor
-
blockPosParser
A parser for block coordinates.- Type Parameters:
C- sender type- Returns:
- a parser descriptor
-
columnPosParser
A parser for column coordinates.- Type Parameters:
C- sender type- Returns:
- a parser descriptor
-
vec2Parser
public static <C> @NonNull ParserDescriptor<C, Coordinates.CoordinatesXZ> vec2Parser(boolean centerIntegers) A parser for coordinates, relative or absolute, from 2 doubles for x and z, with y always defaulting to 0.- Type Parameters:
C- sender type- Parameters:
centerIntegers- whether to center integers at x.5- Returns:
- a parser descriptor
-
vec3Parser
A parser for coordinates, relative or absolute, from 3 doubles.- Type Parameters:
C- sender type- Parameters:
centerIntegers- whether to center integers at x.5- Returns:
- a parser descriptor
-
singlePlayerSelectorParser
A parser forSinglePlayerSelector.- Type Parameters:
C- sender type- Returns:
- a parser descriptor
-
multiplePlayerSelectorParser
public static <C> @NonNull ParserDescriptor<C, MultiplePlayerSelector> multiplePlayerSelectorParser()A parser forMultiplePlayerSelector.- Type Parameters:
C- sender type- Returns:
- a parser descriptor
-
singleEntitySelectorParser
A parser forSingleEntitySelector.- Type Parameters:
C- sender type- Returns:
- a parser instance
-
multipleEntitySelectorParser
public static <C> @NonNull ParserDescriptor<C, MultipleEntitySelector> multipleEntitySelectorParser()A parser forMultipleEntitySelector.- Type Parameters:
C- sender type- Returns:
- a parser instance
-
messageParser
A parser forMessage.- Type Parameters:
C- sender type- Returns:
- a parser instance
-