Possible fix to smp sentry issue

This commit is contained in:
Robert Seifert 2013-06-11 00:48:33 -04:00
parent edfa4739e8
commit 86ad98a2fb

View file

@ -126,26 +126,34 @@ public class EntityTileDamage extends EntityLiving implements IEntityAdditionalS
@Override @Override
public void readSpawnData(ByteArrayDataInput data) public void readSpawnData(ByteArrayDataInput data)
{ {
this.host = this.worldObj.getBlockTileEntity(data.readInt(), data.readInt(), data.readInt()); try
{
this.host = this.worldObj.getBlockTileEntity(data.readInt(), data.readInt(), data.readInt());
}
catch (Exception e)
{
e.printStackTrace();
}
} }
@Override @Override
public void onUpdate() public void onUpdate()
{ {
if (this.host == null || this.host.isInvalid()) if (!this.worldObj.isRemote)
{ {
this.setDead(); if (this.host == null || this.host.isInvalid())
return; {
} this.setDead();
else if (this.host instanceof IHpTile && !((IHpTile) this.host).isAlive()) }
{ else if (this.host instanceof IHpTile && !((IHpTile) this.host).isAlive())
this.setDead(); {
return; this.setDead();
} }
else else
{ {
this.updatePotionEffects(); this.updatePotionEffects();
this.setPosition(this.host.xCoord + 0.5, this.host.yCoord, this.host.zCoord + 0.5); this.setPosition(this.host.xCoord + 0.5, this.host.yCoord, this.host.zCoord + 0.5);
}
} }
} }