Package me.hsgamer.hscore.addon
Class AddonManager
java.lang.Object
me.hsgamer.hscore.expansion.common.ExpansionManager
me.hsgamer.hscore.addon.AddonManager
A class that manages all addons in it
-
Field Summary
Fields inherited from class me.hsgamer.hscore.expansion.common.ExpansionManager
classLoaders, DEFAULT_EXPANSION_FACTORY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAddonManager(@NotNull File addonsDir, @NotNull Logger logger, @NotNull Function<JarFile, ExpansionDescription> addonDescriptionLoader) Create a new addon managerAddonManager(@NotNull File addonsDir, @NotNull Logger logger, @NotNull Function<JarFile, ExpansionDescription> addonDescriptionLoader, @NotNull ClassLoader parentClassLoader) Create a new addon manager -
Method Summary
Modifier and TypeMethodDescriptionvoidCall theAddon.onPostEnable()method of all enabled addonsvoidCall theAddon.onReload()method of all enabled addonsGet the loggerprotected voidonAddonDisable(@NotNull Addon addon) Called when the addon is on disablingprotected voidonAddonDisabled(@NotNull Addon addon) Called when the addon is disabledprotected voidonAddonEnable(@NotNull Addon addon) Called when the addon is on enableprotected voidonAddonEnabled(@NotNull Addon addon) Called when the addon is enabledprotected booleanonAddonLoading(@NotNull Addon addon) Called when the addon is on loadingMethods inherited from class me.hsgamer.hscore.expansion.common.ExpansionManager
addStateListener, call, call, disableExpansions, enableExpansions, getClassLoaders, getDescriptionFactory, getEnabledExpansions, getExpansion, getExpansionClassLoader, getExpansionFactory, getExpansionsDir, getParentClassLoader, loadExpansions, removeStateListener, setExceptionHandler, setSortAndFilterFunction
-
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 fileslogger- the logger to use in every addonaddonDescriptionLoader- the loader to load addon descriptionparentClassLoader- the parent class loader to load all addons
-
AddonManager
protected 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 fileslogger- the logger to use in every addonaddonDescriptionLoader- the loader to load addon description
-
-
Method Details
-
callPostEnable
public void callPostEnable()Call theAddon.onPostEnable()method of all enabled addons -
callReload
public void callReload()Call theAddon.onReload()method of all enabled addons -
onAddonLoading
Called when the addon is on loading- Parameters:
addon- the loading addon- Returns:
- whether the addon is properly loaded
-
onAddonEnable
Called when the addon is on enable- Parameters:
addon- the enabling addon
-
onAddonEnabled
Called when the addon is enabled- Parameters:
addon- the enabled addon
-
onAddonDisable
Called when the addon is on disabling- Parameters:
addon- the disabling addon
-
onAddonDisabled
Called when the addon is disabled- Parameters:
addon- the disabled addon
-
getLogger
Get the logger- Returns:
- the logger
-