Class Addon

java.lang.Object
me.hsgamer.hscore.addon.object.Addon

public abstract class Addon extends Object
The main class of the addon
  • 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

      @NotNull public final @NotNull AddonDescription getDescription()
      Get the addon's description
      Returns:
      the description
    • getAddonManager

      @NotNull public final @NotNull AddonManager getAddonManager()
      Get the addon manager
      Returns:
      the addon manager
    • getDataFolder

      @NotNull public final @NotNull File getDataFolder()
      Get the addon's folder
      Returns:
      the directory for the addon
    • saveResource

      public final void saveResource(@NotNull @NotNull String path, boolean replace)
      Copy the resource from the addon's jar
      Parameters:
      path - path to resource
      replace - whether it replaces the existed one
    • getResource

      @Nullable public final @Nullable InputStream getResource(@NotNull @NotNull String path)
      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

      @NotNull public final @NotNull AddonClassLoader getClassLoader()
      Get the class loader
      Returns:
      the class loader