From 86ad98a2fb7e393affcf65e292932500ed3f4cea Mon Sep 17 00:00:00 2001 From: Robert Seifert Date: Tue, 11 Jun 2013 00:48:33 -0400 Subject: [PATCH] Possible fix to smp sentry issue --- .../dark/library/damage/EntityTileDamage.java | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/minecraft/dark/library/damage/EntityTileDamage.java b/src/minecraft/dark/library/damage/EntityTileDamage.java index 92420b730..709e3e013 100644 --- a/src/minecraft/dark/library/damage/EntityTileDamage.java +++ b/src/minecraft/dark/library/damage/EntityTileDamage.java @@ -126,26 +126,34 @@ public class EntityTileDamage extends EntityLiving implements IEntityAdditionalS @Override 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 public void onUpdate() { - if (this.host == null || this.host.isInvalid()) + if (!this.worldObj.isRemote) { - this.setDead(); - return; - } - else if (this.host instanceof IHpTile && !((IHpTile) this.host).isAlive()) - { - this.setDead(); - return; - } - else - { - this.updatePotionEffects(); - this.setPosition(this.host.xCoord + 0.5, this.host.yCoord, this.host.zCoord + 0.5); + if (this.host == null || this.host.isInvalid()) + { + this.setDead(); + } + else if (this.host instanceof IHpTile && !((IHpTile) this.host).isAlive()) + { + this.setDead(); + } + else + { + this.updatePotionEffects(); + this.setPosition(this.host.xCoord + 0.5, this.host.yCoord, this.host.zCoord + 0.5); + } } }