public void onDisable() { // Unplugging of modules for safe exit for (String s : moduleManager.getModuleList().keySet()) { ModuleBase module = moduleManager.findModule(s); if (moduleManager.isEnabled(module)) { moduleManager.unplugModule(s, true); } } logger.info("DeathEssentials has been disabled"); }
public void onEnable() { this.saveDefaultConfig(); logger = this.getLogger(); new ModuleDependencies(this); moduleManager = new ModuleManager(this); setModuleList(); // Initial plug of modules for (String s : moduleManager.getModuleList().keySet()) { if (moduleManager.getInitialStatus().containsKey(s) && moduleManager.getInitialStatus().get(s)) { moduleManager.plugModule(s); } } // Enable InternalCommands moduleManager.plugModule("InternalCommands"); logger.info("DeathEssentials has been enabled"); }
/** @return List of modules with classes */ public Map<String, ModuleBase> getModuleList() { return moduleManager.getModuleList(); }
/** * For public use, allows a developer to add a module directly from the ModularPlugin base * * @param module Module to be added */ public void addModule(ModuleBase module) { moduleManager.addModule(module); }