Class DataPackCommand
java.lang.Object
net.minecraft.server.commands.DataPackCommand
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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.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.DynamicCommandExceptionTypeprivate static final org.slf4j.Loggerprivate static final com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> private static final com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intcreatePack(CommandSourceStack source, String id, Component description) private static intdisablePack(CommandSourceStack source, Pack unopened) Disables the given pack.private static intenablePack(CommandSourceStack source, Pack unopened, DataPackCommand.Inserter inserter) Enables the given pack.private static PackgetPack(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name, boolean enabling) private static intlistAvailablePacks(CommandSourceStack source) Sends a list of available packs to the user.private static intlistEnabledPacks(CommandSourceStack source) Sends a list of enabled packs to the user.private static intlistPacks(CommandSourceStack source) Sends a list of both enabled and available packs to the user.static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ERROR_UNKNOWN_PACK
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_PACK -
ERROR_PACK_ALREADY_ENABLED
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_PACK_ALREADY_ENABLED -
ERROR_PACK_ALREADY_DISABLED
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_PACK_ALREADY_DISABLED -
ERROR_CANNOT_DISABLE_FEATURE
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_CANNOT_DISABLE_FEATURE -
ERROR_PACK_FEATURES_NOT_ENABLED
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_PACK_FEATURES_NOT_ENABLED -
ERROR_PACK_INVALID_NAME
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_PACK_INVALID_NAME -
ERROR_PACK_INVALID_FULL_NAME
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_PACK_INVALID_FULL_NAME -
ERROR_PACK_ALREADY_EXISTS
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_PACK_ALREADY_EXISTS -
ERROR_PACK_METADATA_ENCODE_FAILURE
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_PACK_METADATA_ENCODE_FAILURE -
ERROR_PACK_IO_FAILURE
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_PACK_IO_FAILURE -
SELECTED_PACKS
private static final com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> SELECTED_PACKS -
UNSELECTED_PACKS
private static final com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> UNSELECTED_PACKS
-
-
Constructor Details
-
DataPackCommand
public DataPackCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
createPack
private static int createPack(CommandSourceStack source, String id, Component description) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
enablePack
private static int enablePack(CommandSourceStack source, Pack unopened, DataPackCommand.Inserter inserter) throws com.mojang.brigadier.exceptions.CommandSyntaxException Enables the given pack.- Returns:
- The number of packs that are loaded after this operation.
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
disablePack
Disables the given pack.- Returns:
- The number of packs that are loaded after this operation.
-
listPacks
Sends a list of both enabled and available packs to the user.- Returns:
- The total number of packs.
-
listAvailablePacks
Sends a list of available packs to the user.- Returns:
- The number of available packs.
-
listEnabledPacks
Sends a list of enabled packs to the user.- Returns:
- The number of enabled packs.
-
getPack
private static Pack getPack(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name, boolean enabling) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-