@Override @Deprecated public BukkitTask runTaskLaterAsynchronously(Plugin plugin, BukkitRunnable task, long delay) throws IllegalArgumentException { return task.runTaskLaterAsynchronously(plugin, delay); }
public synchronized BukkitTask runTaskLaterAsynchronously(Plugin plugin, long delay, T value) throws IllegalArgumentException, IllegalStateException { this.setValue(value); return super.runTaskLaterAsynchronously(plugin, delay); }
/** * Schedule an Expirable task asynchronously * * @param objects the arguments to pass to Expirable.expire() method * @return the task scheduled */ private BukkitTask runTaskLaterAsynchronously(Object...objects) { BukkitRunnable runnable = new Expire(Expirable, Key, objects); org.bukkit.scheduler.BukkitTask task = runnable.runTaskLaterAsynchronously(ByteCart.myPlugin, Expirable.getDuration()); return task; }
public synchronized BukkitTask runTaskLaterAsynchronously(long delay, T value) throws IllegalArgumentException, IllegalStateException { this.setValue(value); return super.runTaskLaterAsynchronously(MyPetApi.getPlugin(), delay); }
/** * Schedule or reschedule an Expirable task with a specific timeout delay * * @param duration the timeout to set * @param objects arguments to pass to the abstract Expirable.expire() method * @return the BukkitTask scheduled */ BukkitTask renewTaskLater(long duration, Object...objects) { BukkitTask task; Map<K,BukkitTask> map = Expirable.getThreadMap(); synchronized(map) { if(! Expirable.getThreadMap().containsKey(Key)) { task = (Expirable.isSync() ? this.runTaskLater(objects) : this.runTaskLaterAsynchronously(objects)); } else { BukkitTask old = Expirable.getThreadMap().get(Key); BukkitRunnable runnable = new Expire(Expirable, Key, objects); if (old.isSync()) task = runnable.runTaskLater(ByteCart.myPlugin, duration); else task = runnable.runTaskLaterAsynchronously(ByteCart.myPlugin, duration); old.cancel(); } Expirable.getThreadMap().put(Key, task); } return task; }