Class Plugin

java.lang.Object
me.neurodock.plugin.Plugin

public abstract class Plugin extends Object
Entry point for the plugin, this is required for the plugin to work, and you MUST annotate it with PluginEntryPoint
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    This is a magic constant plugin name used for when a plugin's name cant be loaded
  • Constructor Summary

    Constructors
    Constructor
    Description
    This shuld be used if PluginEntryPoint.requireData() is false (default)
    Plugin(Data data)
    This shuld be used if PluginEntryPoint.requireData() is true
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract @NotNull PluginMetadata
    This represents your plugin's Metadata
    The "main" method of a plugin, it will be the one returning a list of all tools you define.
    void
    This will be called if the core gets a "fetal" exception or fails to fetch certain info AND the plugin was able to be loaded.
    void
    This will be called after all plugins have been initialized; here it is safe to perform potential stuff where you load data from optional dependencies, or similar things
    void
    This will be called once every plugin has been loaded

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • UNKNOWN_PLUGIN

      public static final String UNKNOWN_PLUGIN
      This is a magic constant plugin name used for when a plugin's name cant be loaded
      See Also:
  • Constructor Details

  • Method Details

    • onInit

      public void onInit()
      This will be called once every plugin has been loaded
    • onDisable

      public void onDisable()
      This will be called if the core gets a "fetal" exception or fails to fetch certain info AND the plugin was able to be loaded.
    • onEnable

      public void onEnable()
      This will be called after all plugins have been initialized; here it is safe to perform potential stuff where you load data from optional dependencies, or similar things
    • getTools

      public Tool[] getTools()
      The "main" method of a plugin, it will be the one returning a list of all tools you define.
      Returns:
      An array of all Tools you provide in this plugin, see Tool for definitions or MAL API tool for ideas or examples
    • getMetadata

      @NotNull public abstract @NotNull PluginMetadata getMetadata()
      This represents your plugin's Metadata
      Returns:
      A PluginMetadata object representing the metadata for your plugin