/** * Starts the task that asks for the votes of all requests */ public void askerTask() { plugin.getServer().getScheduler().scheduleAsyncRepeatingTask(plugin, new Runnable() { @Override public void run() { for (Iterator<Map.Entry<String, Request>> iter = requests.entrySet().iterator(); iter.hasNext(); ) { Request req = iter.next().getValue(); if (req == null) { continue; } if (req.reachedRequestLimit()) { iter.remove(); } ask(req); req.incrementAskCount(); } } }, 0, plugin.getSettingsManager().getRequestFreqencySecs() * 20L); }
@Override public void enable() { CommandBook.inst().createDefaultConfiguration("kits.txt"); // Setup kits kits = new FlatFileKitsManager(new File(CommandBook.inst().getDataFolder(), "kits.txt")); kits.load(); CommandBook.server().getScheduler().scheduleAsyncRepeatingTask( CommandBook.inst(), new GarbageCollector(this), GarbageCollector.CHECK_FREQUENCY, GarbageCollector.CHECK_FREQUENCY); registerCommands(Commands.class); CommandBook.registerEvents(this); }
getServer().getScheduler().scheduleAsyncRepeatingTask(this, new AutoSavingTask(), 1200L, config.getInt("options.auto-save-delay-in-minutes") * 60L * 20L); getServer().getScheduler().scheduleAsyncRepeatingTask(this, ticker, 100L, config.getInt("URID.custom-ticker-delay")); getServer().getScheduler().scheduleAsyncRepeatingTask(this, new Runnable() {