From 38455f3e4bd6eb5f161f6c74a3a14a637fb2861e Mon Sep 17 00:00:00 2001 From: Astoria Date: Wed, 5 Apr 2023 07:39:57 -0500 Subject: [PATCH] Bugfix --- .../api/AbstractWireTileEntity.java | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileEntity.java b/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileEntity.java index 0550b06..5f47be1 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileEntity.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/api/AbstractWireTileEntity.java @@ -80,24 +80,20 @@ public abstract class AbstractWireTileEntity extends TileEntity { WireConnection wire = outputs[i].wire; Boolean doUpdate = false; AbstractWireTileEntity otherChip = (AbstractWireTileEntity)this.worldObj.getBlockTileEntity(wire.x, wire.y, wire.z); - if(otherChip == null){ + if(otherChip == null || otherChip.outputs == null){ this.outputs[i].wire = new WireConnection(); - break; + } else { + if (outputs[i].floatvalue != otherChip.inputs[wire.thatslot].floatvalue) { + otherChip.inputs[wire.thatslot].floatvalue = outputs[i].floatvalue; + doUpdate = true; + } + if (!outputs[i].stringvalue.equals(otherChip.inputs[wire.thatslot].stringvalue)) { + otherChip.inputs[wire.thatslot].stringvalue = outputs[i].stringvalue; + doUpdate = true; + } + if (doUpdate) + otherChip.update(); } - if(otherChip.outputs == null) { - this.outputs[i].wire = new WireConnection(); - break; - } - if(outputs[i].floatvalue != otherChip.inputs[wire.thatslot].floatvalue) { - otherChip.inputs[wire.thatslot].floatvalue = outputs[i].floatvalue; - doUpdate = true; - } - if(!outputs[i].stringvalue.equals(otherChip.inputs[wire.thatslot].stringvalue)) { - otherChip.inputs[wire.thatslot].stringvalue = outputs[i].stringvalue; - doUpdate = true; - } - if(doUpdate) - otherChip.update(); } } }