説明
The StateAware
interface can be implemented by plugin modules which need to know when they are enabled or disabled.
実装
To be notified of enablement/disablement, implement the following in your Macro Plugins, Event Listener Plugins or Component Plugins:
This has two methods you must implement:
Call Sequence
These methods are called in the following circumstances:
enabled()
- At server startup, if the plugin is already installed and enabled.
- If the plugin is installed via uploading
- If the plugin is enabled after having been disabled.
- If the specific module is enabled after having been disabled.
disabled()
- At server shutdown, if the plugin is installed and enabled.
- If the plugin is uninstalled.
- If the plugin is disabled.
- If the specific module is disabled.
注意
Each method is only called once at each logical enablement/disablement event. Please note that the module class's constructor is not a reliable place to put initialisation code either, as the classes are often constructed or destructed more often than they are disabled/enabled. However, once enabled, the same class will remain in memory until it is disabled.
既知の問題
Supported Module Types
Not all module types have been tested, but the following have the following status: