@Override public boolean remove() { org.bukkit.entity.Entity entity = entityRef.get(); if (entity != null) { entity.remove(); return entity.isDead(); } else { return true; } }
if (holder.isDead()) { return false;
.filter(entity -> entity instanceof LivingEntity && !entity.isDead()) .forEach(entity -> { Vector pos = entity.getLocation().toVector();
if (entity.isDead()) { continue;
if (sender instanceof Entity) { Entity entity = (Entity) sender; if (entity.isDead()) { new LocalizedStringImpl("kill.self-dead", commandMessages.getResourceBundle()) .send(entity);
@Override public boolean isValid() { return entity != null && !entity.isDead(); } }
@Override public boolean isDead() { return base.isDead(); }
@Override public boolean isDead() { return e.isDead(); }
public boolean isDead() { return entity.isDead(); }
public static void updateAll() { for (final Entity e : instances.keySet()) { if (e != null && !e.isDead() && instances.get(e) != null) { instances.get(e).update(); } else { instances.remove(e); } } }
/** * Updates the current avoids set for the NPC. */ public void updateAvoids() { for (SentinelCurrentTarget uuid : new HashSet<>(currentAvoids)) { Entity e = SentinelUtilities.getEntityForID(uuid.targetID); if (e == null) { currentAvoids.remove(uuid); continue; } if (e.isDead()) { currentAvoids.remove(uuid); continue; } if (uuid.ticksLeft > 0) { uuid.ticksLeft -= SentinelPlugin.instance.tickRate; if (uuid.ticksLeft <= 0) { currentAvoids.remove(uuid); } } } }
/** * Returns whether an entity is not able to be targeted at all. */ public static boolean isUntargetable(Entity e) { return e == null || (e instanceof Player && (((Player) e).getGameMode() == GameMode.CREATIVE || ((Player) e).getGameMode() == GameMode.SPECTATOR)) || e.isDead(); }
@Override public boolean modify(MageController controller, Entity entity) { // Don't check isValid here since it will be false on the spawn event! if (entity.isDead()) return false; boolean modifiedPre = modifyPreSpawn(controller, entity); boolean modifiedPost = modifyPostSpawn(controller, entity); return modifiedPre || modifiedPost; }
/** * Start the tracker when the plugin is loaded */ @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPluginReady(BentoBoxReadyEvent event) { // Kick off the task to remove entities that go outside island boundaries Bukkit.getScheduler().runTaskTimer(getPlugin(), () -> { mobSpawnTracker.entrySet().stream() .filter(e -> !e.getValue().onIsland(e.getKey().getLocation())) .map(Map.Entry::getKey) .forEach(Entity::remove); mobSpawnTracker.keySet().removeIf(e -> e == null || e.isDead()); }, 20L, 20L); }
protected boolean checkActive() { if (!isActive()) return false; Entity entity = mage.getEntity(); if (entity == null || entity.isDead()) return false; if (entity instanceof Player && !((Player)entity).isOnline()) return false; return true; }
private void removeDeadMonsters() { List<Entity> tmp = new ArrayList<Entity>(monsterManager.getMonsters()); for (Entity e : tmp) { if (e == null) { continue; } if (e.isDead() || !region.contains(e.getLocation())) { monsterManager.remove(e); e.remove(); } } }
/** * Internal use */ public boolean isRemoveDisguiseOnDeath() { return getEntity() == null || (getEntity() instanceof Player ? !isKeepDisguiseOnPlayerDeath() : getEntity().isDead()); }
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) public void onChunkUnload(ChunkUnloadEvent event) { for (Entity entity : event.getChunk().getEntities()) { if (!entity.isDead()) { NMSEntityBase entityBase = nmsManager.getNMSEntityBase(entity); if (entityBase != null) { ((CraftHologram) entityBase.getHologramLine().getParent()).despawnEntities(); } } } }
@Override public void run() { if (!spell.canCast(spell.getLocation())) { spell.land(); return; } if (!spell.checkActive()) { return; } Entity entity = spell.getMage().getEntity(); if (entity == null || entity.isDead()) { spell.land(); return; } if (entity instanceof Player && (!((Player)entity).isOnline() || (spell.isFlightEnabled() && !((Player)entity).isFlying()))) { spell.land(); return; } spell.thrust(); } }