Class PluginHandler
java.lang.Object
tech.anonymoushacker1279.immersiveweapons.api.PluginHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinitializePlugins(net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent event) Initialize plugins.static booleanisPluginActive(String name) Check if a plugin is active.static booleanisPluginRegistered(String name) Check if a plugin has been registered.static voidregisterPlugin(IWPlugin plugin) Register your plugin here from your mod's constructor.
-
Constructor Details
-
PluginHandler
public PluginHandler()
-
-
Method Details
-
initializePlugins
@Internal public static void initializePlugins(net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent event) Initialize plugins. This should NOT be called in your own code, IW will automatically initialize plugins during its common setup stage.- Parameters:
event- theFMLCommonSetupEventinstance
-
registerPlugin
Register your plugin here from your mod's constructor.
Registration will fail in either of the two conditions:
-
a plugin already exists with the name of your plugin
-
the initialization stage has already passed
- Parameters:
plugin- theIWPlugininstance you are registering
-
-
isPluginRegistered
Check if a plugin has been registered. Note, a plugin may be registered but not active. If you are checking if a plugin is active, useisPluginActive(String)instead.- Parameters:
name- the name of the plugin- Returns:
- true if the plugin has been registered, false otherwise
-
isPluginActive
Check if a plugin is active.- Parameters:
name- the name of the plugin- Returns:
- true if the plugin is active, false otherwise
-