Class PlayerCommandRegistry
java.lang.Object
com.ordwen.odailyquests.api.commands.player.PlayerCommandRegistry
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCommandHandler
(String name) Retrieves the command handler associated with the given name.Gets a collection of all registered player command handlers.Gets a set of all registered command names.void
registerCommand
(PlayerCommandBase handler) Registers a new player subcommand handler.
-
Constructor Details
-
PlayerCommandRegistry
public PlayerCommandRegistry()
-
-
Method Details
-
registerCommand
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
Retrieves the command handler associated with the given name.- Parameters:
name
- the name of the subcommand- Returns:
- the corresponding
PlayerCommandBase
, ornull
if not found
-
getCommandHandlers
Gets a collection of all registered player command handlers.- Returns:
- a collection of subcommand names to their handlers
-
getCommandNames
Gets a set of all registered command names.- Returns:
- a set of subcommand names
-