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.ComponentLike> errorPrefixer, String helpCommand, Consumer<org.incendo.cloud.paper.util.sender.Source> noPendingCommandsNotifier, BiConsumer<org.incendo.cloud.paper.util.sender.Source, org.incendo.cloud.processors.confirmation.ConfirmationContext<org.incendo.cloud.paper.util.sender.Source>> confirmationRequestNotifier) Creates a CommandManager instance -
Method Summary
Modifier and TypeMethodDescription<T extends org.incendo.cloud.paper.util.sender.Source>
voidcommand(org.incendo.cloud.Command.Builder<T> command) Registers a Command Builder as a new commandorg.incendo.cloud.paper.PaperCommandManager<org.incendo.cloud.paper.util.sender.Source> manager()gets cloud's CommandManager in case this is neededvoidqueryCommands(String s, org.incendo.cloud.paper.util.sender.Source source) 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.ComponentLike> errorPrefixer, String helpCommand, Consumer<org.incendo.cloud.paper.util.sender.Source> noPendingCommandsNotifier, BiConsumer<org.incendo.cloud.paper.util.sender.Source, org.incendo.cloud.processors.confirmation.ConfirmationContext<org.incendo.cloud.paper.util.sender.Source>> confirmationRequestNotifier) Creates 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"noPendingCommandsNotifier- The message to send if one doesn't have any pending commandsconfirmationRequestNotifier- The Notification to send if you need to confirm something
-
-
Method Details
-
command
public <T extends org.incendo.cloud.paper.util.sender.Source> void command(org.incendo.cloud.Command.Builder<T> command) Registers a Command Builder as a new command- Type Parameters:
T- The Commands Source Class- Parameters:
command- the Command to register
-
manager
public org.incendo.cloud.paper.PaperCommandManager<org.incendo.cloud.paper.util.sender.Source> 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 commandsource- the player who uses the help command
-