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.Component> errorPrefixer, String helpCommand, cloud.commandframework.extra.confirmation.CommandConfirmationManager<org.bukkit.command.CommandSender> confirmationManager)
    Creates a CommandManager instance
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    command(cloud.commandframework.Command.Builder<org.bukkit.command.CommandSender> builder)
    Registers a Command Builder as a new command
    cloud.commandframework.paper.PaperCommandManager<org.bukkit.command.CommandSender>
    gets cloud's CommandManager in case this is needed
    void
    queryCommands(String s, org.bukkit.command.CommandSender sender)
    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.Component> errorPrefixer, String helpCommand, cloud.commandframework.extra.confirmation.CommandConfirmationManager<org.bukkit.command.CommandSender> confirmationManager) throws InstantiationException
      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"
      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

      public void queryCommands(String s, org.bukkit.command.CommandSender sender)
      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
      sender - the player who uses the help command