Class Addon

java.lang.Object
me.hsgamer.hscore.addon.object.Addon
All Implemented Interfaces:
Expansion

public abstract class Addon extends Object implements Expansion
The main class of the addon
  • Constructor Details

    • Addon

      protected Addon()
  • Method Details

    • onPostEnable

      public void onPostEnable()
      Called after all addons enabled
    • onReload

      public void onReload()
      Called when reloading
    • getDescription

      @NotNull public final @NotNull AddonDescription getDescription()
      Get the addon's description
      Returns:
      the description
    • 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
    • getExpansionClassLoader

      public ExpansionClassLoader getExpansionClassLoader()
      Get the expansion class loader
      Returns:
      the class loader