public final class PluginManager
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static boolean |
activatePlugin(PluginContainerImpl plugin) |
Activates a specific plugin.
|
static void |
activatePlugins() |
Activates all plugins.
|
static void |
deactivatePlugin(PluginContainerImpl plugin) |
Deactivates a specific plugin.
|
static void |
deactivatePlugins() |
Deactivate all plugins.
|
static void |
findAndSetupPlugins() |
Loads all plugins annotated with
Plugin found by the client and plugin class loader. |
static java.util.List<Overlay> |
getAllOverlays() |
|
static java.util.List<Overlay> |
getOverlays(Overlay.DrawOrder drawOrder) |
|
static void |
registerEventClass(java.lang.Object instance) |
Registers a class that contains
EventCallback annotated methods, and maps those methods correctly. |
public static void findAndSetupPlugins()
throws java.io.IOException
Plugin found by the client and plugin class loader.
This method should only be called once ever.
java.io.IOException - if finding/getting plugins from the plugin directory failedpublic static void registerEventClass(java.lang.Object instance)
EventCallback annotated methods, and maps those methods correctly.
This method must only be called within Plugin.Setup
or in a constructor/initializer of a plugin.
instance - an instance of a class containing EventCallback annotated methodspublic static void activatePlugins()
Attempts to activate plugins from the directory. If the plugin is toggleable then it will add a new item to the settings panel.
public static boolean activatePlugin(PluginContainerImpl plugin) throws java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
If the plugin fails to activate the settings toggle will be disabled.
plugin - the plugin that should be activatedtrue if the plugin was successfully activated;
false otherwisejava.lang.reflect.InvocationTargetException - if activating the plugin failedjava.lang.IllegalAccessException - if activating the plugin failedpublic static void deactivatePlugins()
public static void deactivatePlugin(PluginContainerImpl plugin)
plugin - the plugin that should be deactivatedpublic static java.util.List<Overlay> getAllOverlays()
public static java.util.List<Overlay> getOverlays(Overlay.DrawOrder drawOrder)