Interface AddonManager


public interface AddonManager
Manages Zentrix addon lifecycle and registration.

This manager handles the registration of third-party addons that extend Zentrix functionality. Addons can register themselves to be tracked and managed by the Zentrix plugin.

Example Usage


 AddonManager addonManager = ZentrixProvider.get().getAddonManager();

 // Check registered addons
 Collection<AddonInfo> addons = addonManager.getRegisteredAddons();
 for (AddonInfo addon : addons) {
     System.out.println("Addon: " + addon.getName() + " v" + addon.getVersion());
 }

 // Check if a specific addon is registered
 if (addonManager.isAddonRegistered("my-addon")) {
     // Addon is active
 }
 
Since:
1.0.0
  • Method Details

    • registerAddon

      void registerAddon(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Registers an addon with Zentrix.

      Note: If you extend ZentrixAddon, registration is handled automatically. Only call this directly if you're not using the base class.

      Parameters:
      plugin - The addon plugin to register
      Throws:
      IllegalArgumentException - if plugin is null
      IllegalStateException - if addon is already registered
    • unregisterAddon

      void unregisterAddon(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Unregisters an addon from Zentrix.

      Note: If you extend ZentrixAddon, unregistration is handled automatically. Only call this directly if you're not using the base class.

      Parameters:
      plugin - The addon plugin to unregister
    • getAddon

      @NotNull @NotNull Optional<AddonManager.AddonInfo> getAddon(@NotNull @NotNull String addonId)
      Gets information about a registered addon by its ID.
      Parameters:
      addonId - The addon's unique identifier (typically the plugin name in lowercase)
      Returns:
      Optional containing the addon info, or empty if not found
    • getAddon

      @NotNull @NotNull Optional<AddonManager.AddonInfo> getAddon(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Gets information about a registered addon by its plugin instance.
      Parameters:
      plugin - The addon plugin
      Returns:
      Optional containing the addon info, or empty if not registered
    • getRegisteredAddons

      @NotNull @NotNull Collection<AddonManager.AddonInfo> getRegisteredAddons()
      Gets all registered addons.
      Returns:
      An unmodifiable collection of addon information (never null, may be empty)
    • isAddonRegistered

      boolean isAddonRegistered(@NotNull @NotNull String addonId)
      Checks if an addon is registered by its ID.
      Parameters:
      addonId - The addon's unique identifier
      Returns:
      true if the addon is registered
    • isAddonRegistered

      boolean isAddonRegistered(@NotNull @NotNull org.bukkit.plugin.Plugin plugin)
      Checks if an addon is registered by its plugin instance.
      Parameters:
      plugin - The addon plugin
      Returns:
      true if the addon is registered
    • getAddonCount

      int getAddonCount()
      Gets the number of registered addons.
      Returns:
      The addon count