From 667033dd6988050fcf9882e2506af79bb09f8fcd Mon Sep 17 00:00:00 2001 From: Astoria Date: Mon, 10 Apr 2023 19:53:50 -0500 Subject: [PATCH] Bugfix and Crashfix --- .../brokenmoon/afloydwiremod/mixin/MixinNetClientHandler.java | 3 ++- .../brokenmoon/afloydwiremod/mixin/MixinNetServerHandler.java | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetClientHandler.java b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetClientHandler.java index 50e7f8b..a543d48 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetClientHandler.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetClientHandler.java @@ -33,7 +33,8 @@ public class MixinNetClientHandler implements INetHandler { @Override public void wiremodHandleOpenWiringGUI(WiremodWiringGuiPacket packet) { - ((IEntityPlayer)this.mc.thePlayer).displayGuiWiring(((ToolWiring)this.mc.thePlayer.inventory.getCurrentItem().getItem()), (AbstractWireTileEntity) this.mc.theWorld.getBlockTileEntity(packet.x, packet.y, packet.z), packet.x2, packet.y2, packet.z2); + if(this.mc.thePlayer.inventory.getCurrentItem().getItem() instanceof ToolWiring) + ((IEntityPlayer)this.mc.thePlayer).displayGuiWiring(((ToolWiring)this.mc.thePlayer.inventory.getCurrentItem().getItem()), (AbstractWireTileEntity) this.mc.theWorld.getBlockTileEntity(packet.x, packet.y, packet.z), packet.x2, packet.y2, packet.z2); } @Override diff --git a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetServerHandler.java b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetServerHandler.java index f4593b2..4ed5094 100644 --- a/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetServerHandler.java +++ b/src/main/java/net/brokenmoon/afloydwiremod/mixin/MixinNetServerHandler.java @@ -77,9 +77,11 @@ public class MixinNetServerHandler implements INetHandler { switch(packet.mode){ case 0: wireEntity.outputs[0].floatvalue = packet.value; + wireEntity.update(); break; case 1: ((ChipTileEntity)wireEntity).tickAmount = (int)packet.value; + wireEntity.update(); break; } }