Getting Started
To get started adding ModularFramework to your Sponge plugin you will need to add it as a dependency as specified on the Home page. It is recommended that you follow the instructions for shading the dependency in as well to give you all the capabilities of the library.
Module Controller
Creating a module controller will allow you to manage the various options you want your modules to have as well as, register, enable and disable modules to your liking. The ModuleController is created by accessing the registerModuleController(pluginInstance, spongeGame)
method inside the ShadedModularFramework
class your plugin depends on. This will then create a new ModuleController. The ModuleController also has a generic argument for your plugin class used like ModuleController<MyPlugin>
. So you should have something that looks like this if it were in your plugin class…
@Listener
public void onGameInitialize(GameInitializationEvent event) {
ModuleController<MyPlugin> moduleController = ShadedModularFramework.registerModuleController(this, Sponge.getGame());
}
Work in progress.