Interface Plugin
public interface Plugin
The entry point of a plugin, named by the
main field of its fidorial.json.
The class needs a public no-argument constructor. The server calls the three lifecycle
methods in order, once each: onLoad(PluginContext) as soon as the plugin is
instantiated, onEnable() once every plugin is loaded, and onDisable() when the
plugin is unloaded or the server stops. Subscriptions, services and permissions the plugin
registered are released after onDisable().
- Since:
- 0.1.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidCalled when the plugin is unloaded, including when the server stops.default voidonEnable()Called once every plugin has been loaded, in dependency order.default voidonLoad(PluginContext context) Called right after the plugin is instantiated, before any other plugin is enabled.
-
Method Details
-
onLoad
Called right after the plugin is instantiated, before any other plugin is enabled.Keep the context: it is the plugin's handle on the server for its whole life.
- Parameters:
context- the context of this plugin- Since:
- 0.1.0
-
onEnable
default void onEnable()Called once every plugin has been loaded, in dependency order.- Since:
- 0.1.0
-
onDisable
default void onDisable()Called when the plugin is unloaded, including when the server stops.- Since:
- 0.1.0
-