Enum Class PluginHelper

java.lang.Object
java.lang.Enum<PluginHelper>
journeymap.api.v2.client.util.PluginHelper
All Implemented Interfaces:
Serializable, Comparable<PluginHelper>, Constable

@ParametersAreNonnullByDefault public enum PluginHelper extends Enum<PluginHelper>
Enum singleton used by JourneyMap to load and initialize plugins. A plugin class must be annotated with the JourneyMapPlugin annotation and also implement the IClientPlugin interface.
  • Enum Constant Details

  • Field Details

    • LOGGER

      public static final org.apache.logging.log4j.Logger LOGGER
    • PLUGIN_INTERFACE_NAME

      public static final String PLUGIN_INTERFACE_NAME
    • plugins

      protected Map<String,IClientPlugin> plugins
    • initialized

      protected boolean initialized
  • Method Details

    • values

      public static PluginHelper[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PluginHelper valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • preInitPlugins

      public Map<String,IClientPlugin> preInitPlugins(List<String> pluginList)
      Called by JourneyMap during it's preInitialization phase to find plugin classes included in other mods and then instantiate them.

      Mods which are testing integration can also call this in a dev environment and pass in a stub implementation, but must never do so in production code.

      Returns:
      map of instantiated plugins, keyed by modId
    • initPlugins

      public Map<String,IClientPlugin> initPlugins(IClientAPI clientAPI)
      Called by JourneyMap during its initialization phase. Can only be called once per runtime.

      Mods which are testing integration can also call this in a dev environment and pass in a stub implementation, but must never do so in production code.

      Parameters:
      clientAPI - Client API implementation
      Returns:
      list of initialized plugins, null if plugin discovery never occurred
    • getPlugins

      public Map<String,IClientPlugin> getPlugins()
      Get the map of plugins, keyed by modId.
      Returns:
      null if preInitPlugins(List) hasn't been called yet