Class CommandManager

java.lang.Object
at.hugob.plugin.library.command.CommandManager

public class CommandManager extends Object
This Class Manages Command creations for cloud commands
  • Constructor Summary

    Constructors
    Constructor
    Description
    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
  • Method Summary

    Modifier and Type
    Method
    Description
    <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
    org.incendo.cloud.paper.PaperCommandManager<org.incendo.cloud.paper.util.sender.Source>
    gets cloud's CommandManager in case this is needed
    void
    queryCommands(String s, org.incendo.cloud.paper.util.sender.Source source)
    This is used for the help command to query for commands

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 instance
      errorPrefixer - the prefix that error messages should have
      helpCommand - the help-command command i.e. "/plugin-name help"
      noPendingCommandsNotifier - The message to send if one doesn't have any pending commands
      confirmationRequestNotifier - 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

      public void queryCommands(String s, org.incendo.cloud.paper.util.sender.Source source)
      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 command
      source - the player who uses the help command