Package at.hugob.plugin.library.command
Class CommandManager
java.lang.Object
at.hugob.plugin.library.command.CommandManager
This Class Manages Command creations for cloud commands
-
Constructor Summary
ConstructorsConstructorDescriptionCommandManager(org.bukkit.plugin.java.JavaPlugin plugin, Function<net.kyori.adventure.text.Component, net.kyori.adventure.text.Component> errorPrefixer, String helpCommand, cloud.commandframework.extra.confirmation.CommandConfirmationManager<org.bukkit.command.CommandSender> confirmationManager) Creates a CommandManager instance -
Method Summary
Modifier and TypeMethodDescriptionvoidcommand(cloud.commandframework.Command.Builder<org.bukkit.command.CommandSender> builder) Registers a Command Builder as a new commandcloud.commandframework.paper.PaperCommandManager<org.bukkit.command.CommandSender>manager()gets cloud's CommandManager in case this is neededvoidqueryCommands(String s, org.bukkit.command.CommandSender sender) This is used for the help command to query for commands
-
Constructor Details
-
CommandManager
public CommandManager(org.bukkit.plugin.java.JavaPlugin plugin, Function<net.kyori.adventure.text.Component, net.kyori.adventure.text.Component> errorPrefixer, String helpCommand, cloud.commandframework.extra.confirmation.CommandConfirmationManager<org.bukkit.command.CommandSender> confirmationManager) throws InstantiationExceptionCreates a CommandManager instance- Parameters:
plugin- The plugin that creates the instanceerrorPrefixer- the prefix that error messages should havehelpCommand- the help-command command i.e. "/plugin-name help"confirmationManager- the manager that manages the confirmations- Throws:
InstantiationException- When cloud's CommandManager can't be created
-
-
Method Details
-
command
public void command(cloud.commandframework.Command.Builder<org.bukkit.command.CommandSender> builder) Registers a Command Builder as a new command- Parameters:
builder- the builder to register
-
manager
public cloud.commandframework.paper.PaperCommandManager<org.bukkit.command.CommandSender> manager()gets cloud's CommandManager in case this is needed- Returns:
- cloud's CommandManager that this manager manages
-
queryCommands
This is used for the help command to query for commands- Parameters:
s- The command that should be queried, e.g. "help" to query for the help commandsender- the player who uses the help command
-