Crash fixes on chips with 0 inputs

main
Astoria 2 years ago
parent c2f8a22b40
commit 9cf6dbdb5a

@ -73,7 +73,7 @@ public class GuiWiring extends GuiScrollable {
tool.sideadd = new ArrayList<Integer>(); tool.sideadd = new ArrayList<Integer>();
} }
} else if(!this.tool.type.equals("unpaired")) { } 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); 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); otherEntity.inputs[tool.slot].wire = new WireConnection(this.wireEntity.xCoord, this.wireEntity.yCoord, this.wireEntity.zCoord, tool.slot, guibutton.slot);
wireEntity.updateIO(); wireEntity.updateIO();
@ -82,7 +82,7 @@ public class GuiWiring extends GuiScrollable {
tool.zadd = new ArrayList<Integer>(); tool.zadd = new ArrayList<Integer>();
tool.sideadd = new ArrayList<Integer>(); tool.sideadd = new ArrayList<Integer>();
tool.type = "unpaired"; 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) { 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); 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); wireEntity.inputs[guibutton.slot].wire = new WireConnection(this.tool.x, this.tool.y, this.tool.z, guibutton.slot, tool.slot);

@ -18,7 +18,7 @@ public class TERWire extends TileEntitySpecialRenderer {
public void renderWireAt(AbstractWireTileEntity wireEntity, double x, double y, double z, float weird) { public void renderWireAt(AbstractWireTileEntity wireEntity, double x, double y, double z, float weird) {
if(wireEntity.outputs != null){ if(wireEntity.outputs != null){
for(int it = 0; it < wireEntity.outputs.length; it++){ 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( this.renderLineBetweenTwoPoints(
wireEntity.xCoord, wireEntity.yCoord, wireEntity.zCoord, wireEntity.xCoord, wireEntity.yCoord, wireEntity.zCoord,
wireEntity.outputs[it].wire.x, wireEntity.outputs[it].wire.y, wireEntity.outputs[it].wire.z, wireEntity.outputs[it].wire.x, wireEntity.outputs[it].wire.y, wireEntity.outputs[it].wire.z,

Loading…
Cancel
Save