Class PlayerCommandRegistry

java.lang.Object
com.ordwen.odailyquests.api.commands.player.PlayerCommandRegistry

public class PlayerCommandRegistry extends Object
Registry for all player subcommands in the plugin.

This class uses HashMap, where each entry maps a subcommand name to its corresponding PlayerCommandBase handler. It provides utility methods to register and retrieve player commands.

Addons can use this registry to register their own player commands.

  • Constructor Details

    • PlayerCommandRegistry

      public PlayerCommandRegistry()
  • Method Details

    • registerCommand

      public void registerCommand(PlayerCommandBase handler)
      Registers a new player subcommand handler.

      The handler is stored using its PlayerCommand.getName() as the key.

      Parameters:
      handler - the player command handler to register
    • getCommandHandler

      public PlayerCommandBase getCommandHandler(String name)
      Retrieves the command handler associated with the given name.
      Parameters:
      name - the name of the subcommand
      Returns:
      the corresponding PlayerCommandBase, or null if not found
    • getCommandHandlers

      public Collection<PlayerCommandBase> getCommandHandlers()
      Gets a collection of all registered player command handlers.
      Returns:
      a collection of subcommand names to their handlers
    • getCommandNames

      public Set<String> getCommandNames()
      Gets a set of all registered command names.
      Returns:
      a set of subcommand names