@Override protected boolean commonDisable() { actionListener.closeInventories(); if (databaseManager.hasConnection()) { databaseManager.closeConnection(); } // clear groups GroupManager.clear(); timer.cancel(); return true; }
@Override protected boolean createManager() { INSTANCE = this; // create moduleManager = new ModuleManager(); entityModuleManager = new EntityModuleManager(); playerManager = new PlayerManager(); protectionManager = new ProtectionManager(); entityProtectionManager = new EntityProtectionManager(); queueManager = new QueueManager(); protectionManager.init(); entityProtectionManager.init(); // database databaseManager = new DatabaseManager(MoneyPitCore.NAME, new File(getDataFolder(), "sqlconfig.yml")); // init moduleManager.init(); entityModuleManager.init(); // load data databaseManager.init(); // create timer autoCloseTask = new AutoCloseBackgroundTask(); timer = new Timer(); timer.scheduleAtFixedRate(autoCloseTask, 0, 2 * 1000); // create some vars MoneyPitCore.vector = new BlockVector("", 0, 0, 0); MoneyPitCore.protectionInfo = new ProtectionInfo(); return true; }