Input Fixes

main
Astoria 2 years ago
parent 3eb1d6cb2e
commit 83ad98169d

@ -82,7 +82,7 @@ public class GuiWiring extends GuiScrollable {
if(this.player instanceof EntityClientPlayerMP){
NetClientHandler netclienthandler = ((EntityClientPlayerMP)this.mc.thePlayer).sendQueue;
netclienthandler.addToSendQueue(new WiremodWiringPacket(wireEntity.xCoord, wireEntity.yCoord, wireEntity.zCoord, 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));
netclienthandler.addToSendQueue(new WiremodWiringPacket(this.tool.x, this.tool.y, this.tool.z, this.wireEntity.xCoord, this.wireEntity.yCoord, this.wireEntity.zCoord, tool.slot, guibutton.slot));
netclienthandler.addToSendQueue(new WiremodWiringPacket(this.tool.x, this.tool.y, this.tool.z, this.wireEntity.xCoord, this.wireEntity.yCoord, this.wireEntity.zCoord, guibutton.slot, tool.slot));
} else{
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);
@ -101,7 +101,7 @@ public class GuiWiring extends GuiScrollable {
if(this.player instanceof EntityClientPlayerMP){
NetClientHandler netclienthandler = ((EntityClientPlayerMP)this.mc.thePlayer).sendQueue;
netclienthandler.addToSendQueue(new WiremodWiringPacket(wireEntity.xCoord, wireEntity.yCoord, wireEntity.zCoord, this.tool.x, this.tool.y, this.tool.z, guibutton.slot, tool.slot, tool.xadd, tool.yadd, tool.zadd, tool.sideadd, true, tool.red, tool.green, tool.blue, tool.alpha, tool.width));
netclienthandler.addToSendQueue(new WiremodWiringPacket(this.tool.x, this.tool.y, this.tool.z, this.wireEntity.xCoord, this.wireEntity.yCoord, this.wireEntity.zCoord, tool.slot, guibutton.slot));
netclienthandler.addToSendQueue(new WiremodWiringPacket(this.wireEntity.xCoord, this.wireEntity.yCoord, this.wireEntity.zCoord, this.tool.x, this.tool.y, this.tool.z, tool.slot, guibutton.slot));
} else{
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);

@ -50,20 +50,15 @@ public class MixinNetServerHandler implements INetHandler {
wireEntity.outputs[packet.slot1].wire = new WireConnection(packet.x2, packet.y2, packet.z2, packet.slot1, packet.slot2, packet.xadd, packet.yadd, packet.zadd, packet.sideadd, packet.backwired, packet.red, packet.green, packet.blue, packet.alpha, packet.width);
} else{
wireEntity = (AbstractWireTileEntity) this.mcServer.getWorldManager(this.playerEntity.dimension).getBlockTileEntity(packet.x2, packet.y2, packet.z2);
wireEntity.outputs[packet.slot2].wire = new WireConnection(packet.x1, packet.y1, packet.z1, packet.slot1, packet.slot2, packet.xadd, packet.yadd, packet.zadd, packet.sideadd, packet.backwired, packet.red, packet.green, packet.blue, packet.alpha, packet.width);
wireEntity.outputs[packet.slot2].wire = new WireConnection(packet.x1, packet.y1, packet.z1, packet.slot2, packet.slot1, packet.xadd, packet.yadd, packet.zadd, packet.sideadd, packet.backwired, packet.red, packet.green, packet.blue, packet.alpha, packet.width);
}
wireEntity.update();
wireEntity.updateIO();
break;
case 1:
AbstractWireTileEntity otherEntity;
if(packet.backwired) {
otherEntity = (AbstractWireTileEntity)this.mcServer.getWorldManager(this.playerEntity.dimension).getBlockTileEntity(packet.x1, packet.y1, packet.z1);
otherEntity.inputs[packet.slot2].wire = new WireConnection(packet.x2, packet.y2, packet.z2, packet.slot1, packet.slot2);
} else{
otherEntity = (AbstractWireTileEntity)this.mcServer.getWorldManager(this.playerEntity.dimension).getBlockTileEntity(packet.x2, packet.y2, packet.z2);
otherEntity.inputs[packet.slot1].wire = new WireConnection(packet.x1, packet.y1, packet.z1, packet.slot1, packet.slot2);
}
AbstractWireTileEntity otherEntity = (AbstractWireTileEntity)this.mcServer.getWorldManager(this.playerEntity.dimension).getBlockTileEntity(packet.x1, packet.y1, packet.z1);
System.out.println(packet.slot1 + " " + packet.slot2);
otherEntity.inputs[packet.slot2].wire = new WireConnection(packet.x2, packet.y2, packet.z2, packet.slot2, packet.slot1);
otherEntity.update();
otherEntity.updateIO();
break;

@ -55,6 +55,7 @@ public class WiremodPacketSyncIO extends Packet {
io[i] = new WiringButton();
io[i].x = dataInputStream.readInt();
io[i].y = dataInputStream.readInt();
io[i].slot = dataInputStream.readInt();
io[i].buttonString = dataInputStream.readUTF();
io[i].floatvalue = dataInputStream.readFloat();
io[i].stringvalue = dataInputStream.readUTF();
@ -91,6 +92,7 @@ public class WiremodPacketSyncIO extends Packet {
oi[i] = new WiringButton();
oi[i].x = dataInputStream.readInt();
oi[i].y = dataInputStream.readInt();
oi[i].slot = dataInputStream.readInt();
oi[i].buttonString = dataInputStream.readUTF();
oi[i].floatvalue = dataInputStream.readFloat();
oi[i].stringvalue = dataInputStream.readUTF();
@ -146,6 +148,8 @@ public class WiremodPacketSyncIO extends Packet {
size = size + 4;
dataOutputStream.writeInt(this.io[i].y);
size = size + 4;
dataOutputStream.writeInt(this.io[i].slot);
size = size + 4;
dataOutputStream.writeUTF(this.io[i].buttonString);
size = size + this.io[i].buttonString.length();
dataOutputStream.writeFloat(this.io[i].floatvalue);
@ -217,6 +221,8 @@ public class WiremodPacketSyncIO extends Packet {
size = size + 4;
dataOutputStream.writeInt(this.oi[i].y);
size = size + 4;
dataOutputStream.writeInt(this.oi[i].slot);
size = size + 4;
dataOutputStream.writeUTF(this.oi[i].buttonString);
size = size + this.oi[i].buttonString.length();
dataOutputStream.writeFloat(this.oi[i].floatvalue);

@ -135,6 +135,7 @@ public class WiremodWiringPacket extends Packet {
@Override
public void processPacket(NetHandler netHandler) {
System.out.println(this.slot1 + " " + this.slot2);
((INetHandler)netHandler).wiremodHandleWireChips(this);
}

Loading…
Cancel
Save