Interface ICommandRegistrationHandler
public interface ICommandRegistrationHandler
Handles registration of commands for the
/ct main command.
All "root" and "sub" terms are re-defined in this context not to consider /ct as the actual root. In other
words, registering a root command named foo will actually register a sub-command accessible through
/ct foo; whereas registering a sub-command bar for the command baz leads to the sub-command
being accessible through /ct baz bar.
- Since:
- 9.1.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents an operation that is responsible for construction of the command given a builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidregisterDump(String dumpId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder) Registers a new command which can be used to dump brackets.voidregisterRootCommand(String commandId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder) Registers a new root command with the given name and description.voidregisterSubCommand(String parentCommand, String commandId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder) Registers a new sub command to the given parent with the specified name and description.
-
Method Details
-
registerRootCommand
void registerRootCommand(String commandId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder) Registers a new root command with the given name and description.The given command will then be accessible at the root level, right after the
/ctmain command.- Parameters:
commandId- The name of the command. Conventionally, the string should be all lower-case and a single word if possible. Multiple words should be merged together withsnake_case.description- AMutableComponentacting as the description of the command, used in/ct helpto guide the user.builder- AICommandRegistrationHandler.CommandBuilderused to create the actual command code.- Since:
- 9.1.0
-
registerSubCommand
void registerSubCommand(String parentCommand, String commandId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder) Registers a new sub command to the given parent with the specified name and description.The parent command must exist, otherwise an error on registration will occur.
- Parameters:
parentCommand- The name of the parent command.commandId- The name of the sub-command. Conventionally, the string should be all lowercase and a single word if possible. Multiple words should be merged together withsnake_case.description- AMutableComponentacting as the description of the command, used in/ct helpto guide the user.builder- AICommandRegistrationHandler.CommandBuilderused to create the actual command code.- Since:
- 9.1.0
-
registerDump
void registerDump(String dumpId, net.minecraft.network.chat.MutableComponent description, ICommandRegistrationHandler.CommandBuilder builder) Registers a new command which can be used to dump brackets.This can be seen as the command equivalent to
IBracketParserRegistrationHandler.DumperData, and the two components work in synergy with one another.- Parameters:
dumpId- The identifier that will be used to invoke this dump command.description- AMutableComponentacting as the description of the command, used in/ct helpto guide the user.builder- AICommandRegistrationHandler.CommandBuilderused to create the actual command code.- Since:
- 9.1.0
-