Package net.minecraft.server.commands
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.Dynamic2CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate 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 intdisablePack(CommandSourceStack pSource, Pack pPack) Disables the given pack.private static intenablePack(CommandSourceStack pSource, Pack pPack, DataPackCommand.Inserter pPriorityCallback) Enables the given pack.private static PackgetPack(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pName, boolean pEnabling) private static intlistAvailablePacks(CommandSourceStack pSource) Sends a list of available packs to the user.private static intlistEnabledPacks(CommandSourceStack pSource) Sends a list of enabled packs to the user.private static intlistPacks(CommandSourceStack pSource) Sends a list of both enabled and available packs to the user.static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> pDispatcher)
-
Field Details
-
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 -
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
-
enablePack
private static int enablePack(CommandSourceStack pSource, Pack pPack, DataPackCommand.Inserter pPriorityCallback) 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> pContext, String pName, boolean pEnabling) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-