diff --git a/src/main/java/vazkii/botania/common/entity/EntityPixie.java b/src/main/java/vazkii/botania/common/entity/EntityPixie.java index 1b0b3edc1..710187c1e 100644 --- a/src/main/java/vazkii/botania/common/entity/EntityPixie.java +++ b/src/main/java/vazkii/botania/common/entity/EntityPixie.java @@ -94,7 +94,7 @@ public class EntityPixie extends EntityFlyingCreature { } else target.attackEntityFrom(DamageSource.causeMobDamage(this), damage); if(effect != null && !(target instanceof EntityPlayer)) target.addPotionEffect(effect); - die(); + setDead(); } } @@ -112,8 +112,9 @@ public class EntityPixie extends EntityFlyingCreature { public void onEntityUpdate() { super.onEntityUpdate(); - if(getAttackTarget() == null || ticksExisted > 200) - die(); + if(!worldObj.isRemote + && (getAttackTarget() == null || ticksExisted > 200)) + setDead(); boolean dark = getType() == 1; if(worldObj.isRemote) @@ -121,12 +122,12 @@ public class EntityPixie extends EntityFlyingCreature { Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, dark ? 0.1F : 1F, dark ? 0.025F : 0.25F, dark ? 0.09F : 0.9F, 0.1F + (float) Math.random() * 0.25F, 12); } - public void die() { - setDead(); - - if(worldObj.isRemote && getType() == 0) + @Override + public void setDead() { + if(worldObj != null && worldObj.isRemote && getType() == 0) for(int i = 0; i < 12; i++) Botania.proxy.sparkleFX(posX + (Math.random() - 0.5) * 0.25, posY + 0.5 + (Math.random() - 0.5) * 0.25, posZ + (Math.random() - 0.5) * 0.25, 1F, 0.25F, 0.9F, 1F + (float) Math.random() * 0.25F, 5); + super.setDead(); } @Override