main
Astoria 1 year ago
parent 1875a2c379
commit 38455f3e4b

@ -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();
}
}
}

Loading…
Cancel
Save