/** * Stops the collision detecting BukkitRunnable. */ public void stopCollisionDetection() { if (this.detectionRunnable != null) { this.detectionRunnable.cancel(); this.detectionRunnable = null; } }
public void remove() { super.cancel(); this.cancelled = true; }
/** Cancels this Runnable **/ @Override public void cancel() { super.cancel(); Lightning.this.tasks.remove(this); }
/** * Cancels hologram updating loop and removes all BetonQuest-registered holograms. */ public void cancel() { if (runnable == null) return; runnable.cancel(); for (Hologram hologram : holograms.keySet()) { hologram.delete(); } }
/** Removes this instance of the ability **/ @Override public void remove() { super.remove(); for (int i = 0; i < this.tasks.size(); i++) { this.tasks.get(i).cancel(); this.tasks.remove(i); i--; } }
@Override public void remove() { super.remove(); for (final BukkitRunnable task : this.tasks) { task.cancel(); } }
/** * Removes the instance of this ability and cancels any current runnables */ public void removeWithTasks() { for (int i = 0; i < this.tasks.size(); i++) { this.tasks.get(i).cancel(); i--; } this.remove(); }
@Override public void remove() { super.remove(); for (final BukkitRunnable task : this.tasks) { task.cancel(); } }
@Override public void remove() { super.remove(); for (final BukkitRunnable task : this.tasks) { task.cancel(); } }
private void cleanUp() { // Cancel Updater if (updater != null) { updater.cancel(); updater = null; } // Destroy all holograms for (NPC npc : npcs.keySet()) { for (NPCHologram npcHologram : npcs.get(npc)) { if (npcHologram.hologram != null) { npcHologram.hologram.delete(); npcHologram.hologram = null; } } } }
@Override public void reload(){ // we didn't set anything up in the first place if(sweepDamageCause != null){ return; } if(task != null){ task.cancel(); } task = new BukkitRunnable() { @Override public void run(){ sweepLocations.clear(); } }; task.runTaskTimer(plugin, 0, 1); }
public void cleanup() { for (BukkitRunnable r : disguiseRunnable.values()) { r.cancel(); } for (Disguise d : disguiseEntity.values()) { d.removeDisguise(); } disguiseClone.clear(); updaterTask.cancel(); }
void interrupt() { if (done) { return; } done = true; try { HandlerList.unregisterAll(this); stopped.run(); super.cancel(); } catch (IllegalStateException e) { // Swallow this exception from super.cancel() } finally { clear(); } }
@EventHandler(priority = EventPriority.MONITOR) public void onDeath(PlayerDeathEvent event) { String playerID = PlayerConverter.getID(event.getEntity()); tagged.remove(playerID); BukkitRunnable runnable = untaggers.remove(playerID); if (runnable != null) runnable.cancel(); } }
public void setDisguiseClone(final String player, Boolean[] options) { if (disguiseRunnable.containsKey(player)) { BukkitRunnable run = disguiseRunnable.remove(player); run.cancel(); run.run(); } BukkitRunnable runnable = new BukkitRunnable() { @Override public void run() { disguiseClone.remove(player); disguiseRunnable.remove(player); } }; runnable.runTaskLater(plugin, 20 * DisguiseConfig.getDisguiseCloneExpire()); disguiseRunnable.put(player, runnable); disguiseClone.put(player, options); }
/** * Called when the NPC spawns in. */ @Override public void onSpawn() { stats_timesSpawned++; setHealth(health); setInvincible(invincible); if (respawnMe != null) { respawnMe.cancel(); respawnMe = null; } }
public void setDisguiseEntity(final String player, Disguise disguise) { if (disguiseRunnable.containsKey(player)) { BukkitRunnable run = disguiseRunnable.remove(player); run.cancel(); run.run(); } BukkitRunnable runnable = new BukkitRunnable() { @Override public void run() { disguiseEntity.remove(player); disguiseRunnable.remove(player); } }; runnable.runTaskLater(plugin, 20 * DisguiseConfig.getDisguiseEntityExpire()); disguiseRunnable.put(player, runnable); disguiseEntity.put(player, disguise); }
@Override public void remove() { super.remove(); for (final BukkitRunnable task : this.tasks) { task.cancel(); } for (final Player flyer : this.flights) { ProjectKorra.flightHandler.removeInstance(flyer, this.getName()); } this.flights.clear(); }
@Override public void remove() { super.remove(); if (this.moving) { this.bPlayer.addCooldown(this); } this.revertBlocks(); for (final BukkitRunnable task : this.tasks) { task.cancel(); } }
@Override public void remove() { super.remove(); for (final BukkitRunnable task : this.tasks) { task.cancel(); } this.revertBlocks(); if (this.waterGrabber != null) { this.waterGrabber.remove(); } this.bPlayer.addCooldown(this); }