Package journeymap.api.v2.client.util
Enum Class PluginHelper
- All Implemented Interfaces:
Serializable,Comparable<PluginHelper>,Constable
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.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanstatic final org.apache.logging.log4j.Loggerstatic final Stringprotected Map<String, IClientPlugin> -
Method Summary
Modifier and TypeMethodDescriptionGet the map of plugins, keyed by modId.initPlugins(IClientAPI clientAPI) Called by JourneyMap during its initialization phase.preInitPlugins(List<String> pluginList) Called by JourneyMap during it's preInitialization phase to find plugin classes included in other mods and then instantiate them.static PluginHelperReturns the enum constant of this class with the specified name.static PluginHelper[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Field Details
-
LOGGER
public static final org.apache.logging.log4j.Logger LOGGER -
PLUGIN_INTERFACE_NAME
-
plugins
-
initialized
protected boolean initialized
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
preInitPlugins
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
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
Get the map of plugins, keyed by modId.- Returns:
- null if
preInitPlugins(List)hasn't been called yet
-