Package me.hsgamer.hscore.addon.object
Class Addon
java.lang.Object
me.hsgamer.hscore.addon.object.Addon
The main class of the addon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal @NotNull AddonManagerGet the addon managerfinal @NotNull AddonClassLoaderGet the class loaderfinal @NotNull FileGet the addon's folderfinal @NotNull AddonDescriptionGet the addon's descriptionfinal @Nullable InputStreamgetResource(@NotNull String path) Get the resource from the addon's jarvoidCalled when disabling the addonvoidonEnable()Called when enabling the addonbooleanonLoad()Called when loading the addonvoidCalled after all addons enabledvoidonReload()Called when reloadingfinal voidsaveResource(@NotNull String path, boolean replace) Copy the resource from the addon's jar
-
Constructor Details
-
Addon
public Addon()Create an addon
-
-
Method Details
-
onLoad
public boolean onLoad()Called when loading the addon- Returns:
- whether the addon loaded properly
-
onEnable
public void onEnable()Called when enabling the addon -
onPostEnable
public void onPostEnable()Called after all addons enabled -
onDisable
public void onDisable()Called when disabling the addon -
onReload
public void onReload()Called when reloading -
getDescription
Get the addon's description- Returns:
- the description
-
getAddonManager
Get the addon manager- Returns:
- the addon manager
-
getDataFolder
Get the addon's folder- Returns:
- the directory for the addon
-
saveResource
Copy the resource from the addon's jar- Parameters:
path- path to resourcereplace- whether it replaces the existed one
-
getResource
Get the resource from the addon's jar- Parameters:
path- path to resource- Returns:
- the InputStream of the resource, or null if it's not found
-
getClassLoader
Get the class loader- Returns:
- the class loader
-