mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 03:39:17 +00:00
Fix pixies instantly despawning clientside
This commit is contained in:
1 file changed
+8
-7
@@ -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
|
||||
|
||||
Reference in new issue
Block a user