Class CommandScanner

java.lang.Object
fr.hytale.loader.command.CommandScanner

public class CommandScanner extends Object
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 Details

    • CommandScanner

      public CommandScanner()
  • Method Details

    • scanAndRegister

      public static void scanAndRegister(SimplePlugin plugin)
      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

      public static void registerCommands(SimplePlugin plugin, Object container)
      Registers all command methods in a container object.

      Scans the container for methods annotated with Command and automatically registers them with the plugin's command registry.

      Parameters:
      plugin - the plugin that owns these commands
      container - the object containing command handler methods