Class DataCommands
java.lang.Object
net.minecraft.server.commands.data.DataCommands
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate static interfacestatic interfaceprivate static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<Function<String, DataCommands.DataProvider>> private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final List<DataCommands.DataProvider> static final List<DataCommands.DataProvider> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> decorateModification(BiConsumer<com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?>, DataCommands.DataManipulatorDecorator> nodeSupplier) private static Stringprivate static intgetData(CommandSourceStack source, DataAccessor accessor) Gets all NBT on the object, and applies syntax highlighting.private static intgetData(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path) Gets a value, which can be of any known NBT type.private static intgetNumeric(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path, double scale) Gets a single numeric element, scaled by the given amount.private static intgetOffset(int index, int length) static TaggetSingleTag(NbtPathArgument.NbtPath path, DataAccessor accessor) getSingletonSource(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, DataCommands.DataProvider sourceProvider) private static intmanipulateData(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, DataCommands.DataProvider targetProvider, DataCommands.DataManipulator manipulator, List<Tag> source) private static intmergeData(CommandSourceStack source, DataAccessor accessor, CompoundTag nbt) Merges the given NBT into the targeted object's NBT.static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher) private static intremoveData(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path) Removes the tag at the end of the path.resolveSourcePath(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, DataCommands.DataProvider sourceProvider) stringifyTagList(List<Tag> source, DataCommands.StringProcessor stringProcessor) private static Stringprivate static Stringprivate static StringvalidatedSubstring(String input, int start, int end)
-
Field Details
-
ERROR_MERGE_UNCHANGED
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_MERGE_UNCHANGED -
ERROR_GET_NOT_NUMBER
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_GET_NOT_NUMBER -
ERROR_GET_NON_EXISTENT
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_GET_NON_EXISTENT -
ERROR_MULTIPLE_TAGS
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_MULTIPLE_TAGS -
ERROR_EXPECTED_OBJECT
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_EXPECTED_OBJECT -
ERROR_EXPECTED_VALUE
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_EXPECTED_VALUE -
ERROR_INVALID_SUBSTRING
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_INVALID_SUBSTRING -
ALL_PROVIDERS
-
TARGET_PROVIDERS
-
SOURCE_PROVIDERS
-
-
Constructor Details
-
DataCommands
public DataCommands()
-
-
Method Details
-
register
-
getAsText
-
stringifyTagList
private static List<Tag> stringifyTagList(List<Tag> source, DataCommands.StringProcessor stringProcessor) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
decorateModification
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> decorateModification(BiConsumer<com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?>, DataCommands.DataManipulatorDecorator> nodeSupplier) -
validatedSubstring
-
substring
-
substring
-
getOffset
private static int getOffset(int index, int length) -
getSingletonSource
private static List<Tag> getSingletonSource(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, DataCommands.DataProvider sourceProvider) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
resolveSourcePath
private static List<Tag> resolveSourcePath(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, DataCommands.DataProvider sourceProvider) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
manipulateData
private static int manipulateData(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, DataCommands.DataProvider targetProvider, DataCommands.DataManipulator manipulator, List<Tag> source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
removeData
private static int removeData(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path) throws com.mojang.brigadier.exceptions.CommandSyntaxException Removes the tag at the end of the path.- Returns:
- 1
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getSingleTag
public static Tag getSingleTag(NbtPathArgument.NbtPath path, DataAccessor accessor) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getData
private static int getData(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path) throws com.mojang.brigadier.exceptions.CommandSyntaxException Gets a value, which can be of any known NBT type.- Returns:
- The value associated with the element: length for strings, size for lists and compounds, and numeric value for primitives.
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getNumeric
private static int getNumeric(CommandSourceStack source, DataAccessor accessor, NbtPathArgument.NbtPath path, double scale) throws com.mojang.brigadier.exceptions.CommandSyntaxException Gets a single numeric element, scaled by the given amount.- Returns:
- The element's value, scaled by scale.
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getData
private static int getData(CommandSourceStack source, DataAccessor accessor) throws com.mojang.brigadier.exceptions.CommandSyntaxException Gets all NBT on the object, and applies syntax highlighting.- Returns:
- 1
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
mergeData
private static int mergeData(CommandSourceStack source, DataAccessor accessor, CompoundTag nbt) throws com.mojang.brigadier.exceptions.CommandSyntaxException Merges the given NBT into the targeted object's NBT.- Returns:
- 1
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-