Пример #1
0
 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");
 }
Пример #2
0
 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");
 }
Пример #3
0
 /** @return List of modules with classes */
 public Map<String, ModuleBase> getModuleList() {
   return moduleManager.getModuleList();
 }
Пример #4
0
 /**
  * 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);
 }