-
Notifications
You must be signed in to change notification settings - Fork 2
Modules
Modules are the heart of this module loader, perhaps unsurprisingly. Modules are simply classes that allow QSML to setup a module.
A module is made up of two parts:
- The
Moduleinterface, which should extend a class that represents a module. - The
ModuleDataannotation for decorating a module class..
Strictly speaking, only the Module interface is required, however, using the ModuleData annotation is strongly recommended.
The only method that is required to be implemented in the Module interface is the onEnable method. This method will run the logic for setting up your module. There are also onPreEnable and onPostEnable methods that you can fill out for running before or after this onEnable method. Note that QSML runs all modules' onPreEnable, onEnable and onPostEnable methods together, so in onEnable, you can be sure that every module has at least run the onPreEnable method.
The getConfigAdapter method is used to register a configuration section in the main configuration file. Configuration adapters will be discussed in a future doc update.
The ModuleData annotation allows you to specify how the modules are displayed to the user. This decorates the class that implements the Module interface
-
idwill be used in identifying the module, including in the configuration file. -
namewill potentially be displayed to the user. -
statuswill define whether the module will load by default. -
isRequiredwill define whether the module MUST always be loaded.