From 4e07c1083a2ae34e5bb3eaf959e380cda681373b Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sun, 20 Aug 2023 15:49:51 +0700 Subject: [PATCH] fix core --- .../chipmunkmod/modules/CommandCore.java | 88 ++++++++++++++----- 1 file changed, 68 insertions(+), 20 deletions(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java index d0c8ff4..cdf9c53 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java @@ -140,16 +140,40 @@ public class CommandCore { final ClientConnection connection = client.getNetworkHandler().getConnection(); final BlockPos currentBlock = currentBlockAbsolute(); - connection.send( - new UpdateCommandBlockC2SPacket( - currentBlock, - command, - KaboomCheck.INSTANCE.isKaboom ? CommandBlockBlockEntity.Type.AUTO : CommandBlockBlockEntity.Type.REDSTONE, - false, - false, - true - ) - ); + if (KaboomCheck.INSTANCE.isKaboom) { + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + command, + CommandBlockBlockEntity.Type.AUTO, + false, + false, + true + ) + ); + } else { + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + "", + CommandBlockBlockEntity.Type.REDSTONE, + false, + false, + false + ) + ); + + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + command, + CommandBlockBlockEntity.Type.REDSTONE, + false, + false, + true + ) + ); + } incrementCurrentBlock(); } @@ -158,16 +182,40 @@ public class CommandCore { final ClientConnection connection = client.getNetworkHandler().getConnection(); final BlockPos currentBlock = currentBlockAbsolute(); - connection.send( - new UpdateCommandBlockC2SPacket( - currentBlock, - command, - KaboomCheck.INSTANCE.isKaboom ? CommandBlockBlockEntity.Type.AUTO : CommandBlockBlockEntity.Type.REDSTONE, - true, - false, - true - ) - ); + if (KaboomCheck.INSTANCE.isKaboom) { + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + command, + CommandBlockBlockEntity.Type.AUTO, + true, + false, + true + ) + ); + } else { + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + "", + CommandBlockBlockEntity.Type.REDSTONE, + true, + false, + false + ) + ); + + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + command, + CommandBlockBlockEntity.Type.REDSTONE, + true, + false, + true + ) + ); + } incrementCurrentBlock();