Class CommandScanner
java.lang.Object
fr.hytale.loader.command.CommandScanner
Utility class for scanning and registering command handlers.
This class automatically discovers methods annotated with Command
and registers them as server commands. It handles command properties such as
names, aliases, descriptions, and permissions.
- Since:
- 1.0.0
- Version:
- 1.0.4
- Author:
- HytaleLoader
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidregisterCommands(SimplePlugin plugin, Object container) Registers all command methods in a container object.static voidscanAndRegister(SimplePlugin plugin) Scans and registers all command methods in the plugin.
-
Constructor Details
-
CommandScanner
public CommandScanner()
-
-
Method Details
-
scanAndRegister
Scans and registers all command methods in the plugin.This is a convenience method that calls
registerCommands(SimplePlugin, Object)with the plugin as both the plugin and container parameters.- Parameters:
plugin- the plugin to scan for commands
-
registerCommands
Registers all command methods in a container object.Scans the container for methods annotated with
Commandand automatically registers them with the plugin's command registry.- Parameters:
plugin- the plugin that owns these commandscontainer- the object containing command handler methods
-