@Override public void onDisable() { // Disable listeners HandlerList.unregisterAll(this); // Stop shedulers getServer().getScheduler().cancelTasks(this); if (p == null) { return; } // save Data to Disk DataSave.save(true); // save LanguageReader languageReader.save(); // delete Data from Ram Barrel.barrels.clear(); BCauldron.bcauldrons.clear(); BIngredients.possibleIngredients.clear(); BIngredients.recipes.clear(); BIngredients.cookedNames.clear(); BPlayer.clear(); Brew.potions.clear(); Wakeup.wakeups.clear(); Words.words.clear(); this.log(this.getDescription().getName() + " disabled!"); }
@Override public void run() { for (BCauldron cauldron : BCauldron.bcauldrons) { cauldron.onUpdate(); // runs every min to update cooking time } Barrel.onUpdate(); // runs every min to check and update ageing time BPlayer.onUpdate(); // updates players drunkeness debugLog("Update"); DataSave.autoSave(); }
@Override public void run() { if (!BPlayer.isEmpty()) { BPlayer.drunkeness(); } }