Class AbstractMindustryPlugin

java.lang.Object
mindustry.mod.Mod
mindustry.mod.Plugin
com.xpdustry.distributor.common.plugin.AbstractMindustryPlugin
All Implemented Interfaces:
MindustryPlugin
Direct Known Subclasses:
DistributorCommonPlugin

public abstract class AbstractMindustryPlugin extends mindustry.mod.Plugin implements MindustryPlugin
An abstract implementation of MindustryPlugin, without the quirks of Plugin (like the fact that registerServerCommands(CommandHandler) is called before init()).
It also registers the annotated methods of this plugin and its listeners in the event bus and the plugin scheduler automatically.
  • Constructor Details

    • AbstractMindustryPlugin

      public AbstractMindustryPlugin()
  • Method Details

    • getMetadata

      public final PluginMetadata getMetadata()
      Description copied from interface: MindustryPlugin
      Returns the metadata of this plugin.
      Specified by:
      getMetadata in interface MindustryPlugin
    • getLogger

      public final org.slf4j.Logger getLogger()
      Description copied from interface: MindustryPlugin
      Returns the logger bound to this plugin.
      Specified by:
      getLogger in interface MindustryPlugin
    • getListeners

      protected final List<PluginListener> getListeners()
      Returns an unmodifiable list of the listeners registered to this plugin.
    • getPluginAnnotationParser

      protected PluginAnnotationParser getPluginAnnotationParser()
    • addListener

      public void addListener(PluginListener listener)
      Description copied from interface: MindustryPlugin
      Adds a PluginListener to this plugin.
      Specified by:
      addListener in interface MindustryPlugin
      Parameters:
      listener - the listener to add
    • registerServerCommands

      @Deprecated public final void registerServerCommands(arc.util.CommandHandler handler)
      Deprecated.
      Overrides:
      registerServerCommands in class mindustry.mod.Mod
    • registerClientCommands

      @Deprecated public final void registerClientCommands(arc.util.CommandHandler handler)
      Deprecated.
      Overrides:
      registerClientCommands in class mindustry.mod.Mod
    • init

      @Deprecated public void init()
      Deprecated.
      Overrides:
      init in class mindustry.mod.Mod
    • loadContent

      @Deprecated public void loadContent()
      Deprecated.
      Overrides:
      loadContent in class mindustry.mod.Mod
    • getConfig

      @Deprecated public arc.files.Fi getConfig()
      Deprecated.
      Overrides:
      getConfig in class mindustry.mod.Mod