diff --git a/src/main/java/net/brokenmoon/afloydwiremod/gui/GuiWiring.java b/src/main/java/net/brokenmoon/afloydwiremod/gui/GuiWiring.java index 295bbb7..b10f44c 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/gui/GuiWiring.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/gui/GuiWiring.java @@ -73,7 +73,7 @@ public class GuiWiring extends GuiScrollable { tool.sideadd = new ArrayList(); } } else if(!this.tool.type.equals("unpaired")) { - if(this.tool.type.equals("input") && this.wireEntity.inputs[tool.slot].wire.isMade != true) { + if(this.tool.type.equals("input") && wireEntity.outputs[tool.slot].wire.isMade != true && otherEntity.inputs[guibutton.slot].wire.isMade != true) { wireEntity.outputs[guibutton.slot].wire = new WireConnection(this.tool.x, this.tool.y, this.tool.z, guibutton.slot, tool.slot, tool.xadd, tool.yadd, tool.zadd, tool.sideadd, false, tool.red, tool.green, tool.blue, tool.alpha, tool.width); otherEntity.inputs[tool.slot].wire = new WireConnection(this.wireEntity.xCoord, this.wireEntity.yCoord, this.wireEntity.zCoord, tool.slot, guibutton.slot); wireEntity.updateIO(); @@ -82,7 +82,7 @@ public class GuiWiring extends GuiScrollable { tool.zadd = new ArrayList(); tool.sideadd = new ArrayList(); tool.type = "unpaired"; - } else if(this.tool.type.equals("output") && otherEntity.outputs[tool.slot].wire.isMade != true) { + } else if(this.tool.type.equals("output") && otherEntity.outputs[tool.slot].wire.isMade != true && wireEntity.inputs[tool.slot].wire.isMade != true ) { if(otherEntity != null) { otherEntity.outputs[tool.slot].wire = new WireConnection(this.wireEntity.xCoord, this.wireEntity.yCoord, this.wireEntity.zCoord, tool.slot, guibutton.slot, tool.xadd, tool.yadd, tool.zadd, tool.sideadd, true, tool.red, tool.green, tool.blue, tool.alpha, tool.width); wireEntity.inputs[guibutton.slot].wire = new WireConnection(this.tool.x, this.tool.y, this.tool.z, guibutton.slot, tool.slot); diff --git a/src/main/java/net/brokenmoon/afloydwiremod/ter/TERWire.java b/src/main/java/net/brokenmoon/afloydwiremod/ter/TERWire.java index d08c033..c96f839 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/ter/TERWire.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/ter/TERWire.java @@ -18,7 +18,7 @@ public class TERWire extends TileEntitySpecialRenderer { public void renderWireAt(AbstractWireTileEntity wireEntity, double x, double y, double z, float weird) { if(wireEntity.outputs != null){ for(int it = 0; it < wireEntity.outputs.length; it++){ - if(wireEntity.outputs[it].wire != null && wireEntity.outputs[it].wire.isMade){ + if(wireEntity.outputs[it] != null && wireEntity.outputs[it].wire != null && wireEntity.outputs[it].wire.isMade){ this.renderLineBetweenTwoPoints( wireEntity.xCoord, wireEntity.yCoord, wireEntity.zCoord, wireEntity.outputs[it].wire.x, wireEntity.outputs[it].wire.y, wireEntity.outputs[it].wire.z,