Possible fix to smp sentry issue
This commit is contained in:
parent
edfa4739e8
commit
86ad98a2fb
1 changed files with 22 additions and 14 deletions
|
@ -125,22 +125,29 @@ public class EntityTileDamage extends EntityLiving implements IEntityAdditionalS
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readSpawnData(ByteArrayDataInput data)
|
public void readSpawnData(ByteArrayDataInput data)
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
this.host = this.worldObj.getBlockTileEntity(data.readInt(), data.readInt(), data.readInt());
|
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.worldObj.isRemote)
|
||||||
{
|
{
|
||||||
if (this.host == null || this.host.isInvalid())
|
if (this.host == null || this.host.isInvalid())
|
||||||
{
|
{
|
||||||
this.setDead();
|
this.setDead();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (this.host instanceof IHpTile && !((IHpTile) this.host).isAlive())
|
else if (this.host instanceof IHpTile && !((IHpTile) this.host).isAlive())
|
||||||
{
|
{
|
||||||
this.setDead();
|
this.setDead();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -148,6 +155,7 @@ public class EntityTileDamage extends EntityLiving implements IEntityAdditionalS
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
|
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
|
||||||
|
|
Loading…
Reference in a new issue