|
|
|
@ -16,6 +16,7 @@ public class GuiWiring extends GuiScrollable {
|
|
|
|
|
private int y;
|
|
|
|
|
private int z;
|
|
|
|
|
private AbstractWireTileEntity wireEntity;
|
|
|
|
|
private AbstractWireTileEntity otherEntity;
|
|
|
|
|
@Override
|
|
|
|
|
public void initGui() {
|
|
|
|
|
//this.height - 240 is top
|
|
|
|
@ -41,6 +42,7 @@ public class GuiWiring extends GuiScrollable {
|
|
|
|
|
this.y = y;
|
|
|
|
|
this.z = z;
|
|
|
|
|
this.wireEntity = wireEntity;
|
|
|
|
|
otherEntity = (AbstractWireTileEntity)Minecraft.getMinecraft().theWorld.getBlockTileEntity(tool.x, tool.y, tool.z);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -71,18 +73,19 @@ public class GuiWiring extends GuiScrollable {
|
|
|
|
|
tool.sideadd = new ArrayList<Integer>();
|
|
|
|
|
}
|
|
|
|
|
} else if(!this.tool.type.equals("unpaired")) {
|
|
|
|
|
if(this.tool.type.equals("input")) {
|
|
|
|
|
if(this.tool.type.equals("input") && this.wireEntity.inputs[tool.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();
|
|
|
|
|
tool.xadd = new ArrayList<Integer>();
|
|
|
|
|
tool.yadd = new ArrayList<Integer>();
|
|
|
|
|
tool.zadd = new ArrayList<Integer>();
|
|
|
|
|
tool.sideadd = new ArrayList<Integer>();
|
|
|
|
|
tool.type = "unpaired";
|
|
|
|
|
} else if(this.tool.type.equals("output")) {
|
|
|
|
|
AbstractWireTileEntity otherEntity = (AbstractWireTileEntity)Minecraft.getMinecraft().theWorld.getBlockTileEntity(tool.x, tool.y, tool.z);
|
|
|
|
|
} else if(this.tool.type.equals("output") && otherEntity.outputs[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);
|
|
|
|
|
otherEntity.updateIO();
|
|
|
|
|
}
|
|
|
|
|
tool.xadd = new ArrayList<Integer>();
|
|
|
|
@ -90,6 +93,12 @@ public class GuiWiring extends GuiScrollable {
|
|
|
|
|
tool.zadd = new ArrayList<Integer>();
|
|
|
|
|
tool.sideadd = new ArrayList<Integer>();
|
|
|
|
|
tool.type = "unpaired";
|
|
|
|
|
} else{
|
|
|
|
|
tool.xadd = new ArrayList<Integer>();
|
|
|
|
|
tool.yadd = new ArrayList<Integer>();
|
|
|
|
|
tool.zadd = new ArrayList<Integer>();
|
|
|
|
|
tool.sideadd = new ArrayList<Integer>();
|
|
|
|
|
tool.type = "unpaired";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
this.mc.displayGuiScreen(null);
|
|
|
|
|