remove dead entities

This commit is contained in:
Ellpeck 2017-02-13 20:13:24 +01:00
parent bdabd081be
commit 910f4aaf9e

View file

@ -54,7 +54,7 @@ public class ItemInfraredGoggles extends ItemArmorAA{
if(!this.cachedGlowingEntities.isEmpty()){
for(Entity entity : this.cachedGlowingEntities){
if(entity.getDistanceSq(player.posX, player.posY, player.posZ) > range*range){
if(entity.isDead || entity.getDistanceSq(player.posX, player.posY, player.posZ) > range*range){
entity.setGlowing(false);
this.cachedGlowingEntities.remove(entity);