Fixed EM Contractor link packets

This commit is contained in:
Calclavia 2013-08-04 18:19:24 -04:00
parent 797f50f84a
commit e189636464

View file

@ -72,7 +72,6 @@ public class TileEntityEMContractor extends TileEntityBase implements IPacketRec
{ {
this.setLink((TileEntityEMContractor) this.tempLinkVector.getTileEntity(this.worldObj), true); this.setLink((TileEntityEMContractor) this.tempLinkVector.getTileEntity(this.worldObj), true);
System.out.println("TEST" + this.linked); System.out.println("TEST" + this.linked);
} }
this.tempLinkVector = null; this.tempLinkVector = null;
@ -452,7 +451,12 @@ public class TileEntityEMContractor extends TileEntityBase implements IPacketRec
energyStored = input.readFloat(); energyStored = input.readFloat();
this.dyeID = input.readInt(); this.dyeID = input.readInt();
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); if (input.readBoolean())
{
this.tempLinkVector = new Vector3(input.readInt(), input.readInt(), input.readInt());
}
this.worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
updateBounds(); updateBounds();
} }
catch (Exception e) catch (Exception e)
@ -468,6 +472,18 @@ public class TileEntityEMContractor extends TileEntityBase implements IPacketRec
data.add(energyStored); data.add(energyStored);
data.add(this.dyeID); data.add(this.dyeID);
if (this.linked != null)
{
data.add(true);
data.add(this.linked.xCoord);
data.add(this.linked.yCoord);
data.add(this.linked.zCoord);
}
else
{
data.add(false);
}
return data; return data;
} }