Class MinecraftServerMcpPluginBootstrap

java.lang.Object
eu.mrapik.minecraftservermcp.internal.MinecraftServerMcpPluginBootstrap

public final class MinecraftServerMcpPluginBootstrap extends Object
Bootstrap class; Loads config.yml, starts the embedded MCP HTTP (and optional HTTPS) server, and registers MinecraftServerMcp in the Bukkit ServicesManager.

Startup fails (plugin disables itself) when: configuration is invalid (e.g. bad ssl block), access has no usable tokens, or the HTTP server throws while binding or starting. Failures are logged at Level.SEVERE with the full exception attached—never to raw stderr.

On disable, registered services are cleared and the MCP/Jetty stack is stopped.

  • Constructor Details

    • MinecraftServerMcpPluginBootstrap

      public MinecraftServerMcpPluginBootstrap(BukkitAccess bukkit)
      Constructor parameters are passed by the plugin's main class to avoid a direct dependency on the plugin class itself,
      Parameters:
      bukkit - abstraction of Bukkit API access; allows this class to be managed and tested without a real plugin instance
  • Method Details

    • onEnable

      public void onEnable(JavaPlugin plugin)
      Startup logic: loads configuration, starts the MCP/Jetty stack, and registers services and commands.
      Parameters:
      plugin - MCP plugin instance; used for config access, logging, and as the owner for registered services and the HTTP server
    • onDisable

      public void onDisable(JavaPlugin plugin)
      Shutdown logic: unregisters services and stops the MCP/Jetty stack.
      Parameters:
      plugin - MCP plugin instance; used as the owner for unregistering services and stopping the HTTP server