Class AddonManager


public class AddonManager extends ExpansionManager
A class that manages all addons in it
  • Constructor Details

    • AddonManager

      public AddonManager(@NotNull @NotNull File addonsDir, @NotNull @NotNull Logger logger, @NotNull @NotNull Function<JarFile,ExpansionDescription> addonDescriptionLoader, @NotNull @NotNull ClassLoader parentClassLoader)
      Create a new addon manager
      Parameters:
      addonsDir - the directory to store addon files
      logger - the logger to use in every addon
      addonDescriptionLoader - the loader to load addon description
      parentClassLoader - the parent class loader to load all addons
    • AddonManager

      public AddonManager(@NotNull @NotNull File addonsDir, @NotNull @NotNull Logger logger, @NotNull @NotNull Function<JarFile,ExpansionDescription> addonDescriptionLoader)
      Create a new addon manager
      Parameters:
      addonsDir - the directory to store addon files
      logger - the logger to use in every addon
      addonDescriptionLoader - the loader to load addon description
  • Method Details

    • callPostEnable

      public void callPostEnable()
      Call the Addon.onPostEnable() method of all enabled addons
    • callReload

      public void callReload()
      Call the Addon.onReload() method of all enabled addons
    • onAddonLoading

      protected boolean onAddonLoading(@NotNull @NotNull Addon addon)
      Called when the addon is on loading
      Parameters:
      addon - the loading addon
      Returns:
      whether the addon is properly loaded
    • onAddonEnable

      protected void onAddonEnable(@NotNull @NotNull Addon addon)
      Called when the addon is on enable
      Parameters:
      addon - the enabling addon
    • onAddonEnabled

      protected void onAddonEnabled(@NotNull @NotNull Addon addon)
      Called when the addon is enabled
      Parameters:
      addon - the enabled addon
    • onAddonDisable

      protected void onAddonDisable(@NotNull @NotNull Addon addon)
      Called when the addon is on disabling
      Parameters:
      addon - the disabling addon
    • onAddonDisabled

      protected void onAddonDisabled(@NotNull @NotNull Addon addon)
      Called when the addon is disabled
      Parameters:
      addon - the disabled addon
    • getLogger

      public Logger getLogger()
      Get the logger
      Returns:
      the logger