Interface CommandRegistry
public interface CommandRegistry
Handles and manages all sub-commands for the plugin.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSubCommand
(ACommand aCommand) Register a sub-command to the registry.void
executeCommand
(Player player, String command) Execute a config command with the correct syntax.Retrieve a list of all the sub-commands added viaaddSubCommand(ACommand)
This doesn't include internal sub-commands provided by the plugin.void
registerCommandPlaceholder
(String placeholder, Function<Player, String> value) Register a config command placeholder.void
removeSubCommand
(String name) Removes a sub-command from the registry.
-
Method Details
-
addSubCommand
Register a sub-command to the registry.- Parameters:
aCommand
- The command instance.
-
removeSubCommand
Removes a sub-command from the registry.- Parameters:
name
- The command name fromACommand.name
.
-
getCommands
Retrieve a list of all the sub-commands added viaaddSubCommand(ACommand)
This doesn't include internal sub-commands provided by the plugin.- Returns:
- List of all the sub-commands.
-
executeCommand
Execute a config command with the correct syntax.- Parameters:
player
- Player the command will be executed on.command
- The command syntax.
-
registerCommandPlaceholder
Register a config command placeholder.- Parameters:
placeholder
- The placeholder to replace.value
- The value to replace the placeholder with.
-