@Override public void onEnable() { saveDefaultConfig(); consoleLogger = new CustomLogger(getLogger()); blockMetaStorage = new BlockMetaStorage(this, getDataFolder(), consoleLogger); repeaterTaskStorage = new RepeaterTaskStorage(this, getDataFolder(), consoleLogger); explosivesConfig = loadConfig(getConfig(), consoleLogger); repeaterTaskStorage.restore(); loadExplosives(); saveTask = new TaskPeriodicSave(this).runTaskTimer(this, SAVE_INTERVAL, SAVE_INTERVAL); getServer() .getPluginManager() .registerEvents(new ExplosivesBlocksListener(this, consoleLogger), this); getServer() .getPluginManager() .registerEvents(new ExplosivesActivateListener(this, consoleLogger), this); getServer().getPluginManager().registerEvents(new ExplosivesCraftListener(this), this); getCommand(COMMAND_NS).setExecutor(new CustomNukesCommandExecutor(this)); consoleLogger.info("Plugin enabled"); }
public void clear() { blockMetaStorage.clear(); repeaterTaskStorage.clear(); }
public void saveData() { repeaterTaskStorage.save(); blockMetaStorage.save(); }