Class Plugin

java.lang.Object
emu.grasscutter.plugin.Plugin

public abstract class Plugin extends Object
The base class for all plugins to extend.
  • Constructor Details

    • Plugin

      public Plugin()
  • Method Details

    • getIdentifier

      public final PluginIdentifier getIdentifier()
      The plugin's identifier instance.
      Returns:
      An instance of PluginIdentifier.
    • getName

      public final String getName()
      Get the plugin's name.
    • getDescription

      public final String getDescription()
      Get the plugin's description.
    • getVersion

      public final String getVersion()
      Get the plugin's version.
    • getServer

      public final GameServer getServer()
      Returns the server that initialized the plugin.
      Returns:
      A server instance.
    • getResource

      public final InputStream getResource(String resourceName)
      Returns an input stream for a resource in the JAR file.
      Parameters:
      resourceName - The name of the resource.
      Returns:
      An input stream.
    • getDataFolder

      public final File getDataFolder()
      Returns a directory where plugins can store data files.
      Returns:
      A directory on the file system.
    • getHandle

      public final ServerHook getHandle()
      Returns the server hook.
      Returns:
      A server hook singleton.
    • getLogger

      public final org.slf4j.Logger getLogger()
      Returns the plugin's logger.
      Returns:
      A SLF4J logger.
    • onLoad

      public void onLoad()
    • onEnable

      public void onEnable()
    • onDisable

      public void onDisable()