diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java index 8e00299..31209e5 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CommandCore.java @@ -2,8 +2,6 @@ package land.chipmunk.chipmunkmod.modules; import land.chipmunk.chipmunkmod.ChipmunkMod; import land.chipmunk.chipmunkmod.data.BlockArea; - - import land.chipmunk.chipmunkmod.listeners.Listener; import land.chipmunk.chipmunkmod.listeners.ListenerManager; import net.minecraft.block.entity.CommandBlockBlockEntity; @@ -15,7 +13,6 @@ import net.minecraft.network.packet.c2s.play.UpdateCommandBlockC2SPacket; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; -import java.util.List; import java.util.Timer; import java.util.TimerTask; import java.util.concurrent.CompletableFuture; @@ -139,9 +136,16 @@ public class CommandCore { final ClientConnection connection = client.getNetworkHandler().getConnection(); final BlockPos currentBlock = currentBlockAbsolute(); - // TODO: Support using repeating command blocks (on kaboom-like servers) (because less packets) - connection.send(new UpdateCommandBlockC2SPacket(currentBlock, "", CommandBlockBlockEntity.Type.REDSTONE, false, false, false)); - connection.send(new UpdateCommandBlockC2SPacket(currentBlock, command, CommandBlockBlockEntity.Type.REDSTONE, false, false, true)); + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + command, + KaboomCheck.INSTANCE.isKaboom ? CommandBlockBlockEntity.Type.AUTO : CommandBlockBlockEntity.Type.REDSTONE, + false, + false, + true + ) + ); incrementCurrentBlock(); } @@ -150,9 +154,16 @@ public class CommandCore { final ClientConnection connection = client.getNetworkHandler().getConnection(); final BlockPos currentBlock = currentBlockAbsolute(); - // TODO: Support using repeating command blocks (on kaboom-like servers) (because less packets) - connection.send(new UpdateCommandBlockC2SPacket(currentBlock, "", CommandBlockBlockEntity.Type.SEQUENCE, false, false, false)); - connection.send(new UpdateCommandBlockC2SPacket(currentBlock, command, CommandBlockBlockEntity.Type.REDSTONE, true, false, true)); + connection.send( + new UpdateCommandBlockC2SPacket( + currentBlock, + command, + KaboomCheck.INSTANCE.isKaboom ? CommandBlockBlockEntity.Type.AUTO : CommandBlockBlockEntity.Type.REDSTONE, + true, + false, + true + ) + ); incrementCurrentBlock(); diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java index 1aba8da..2018f25 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/CustomChat.java @@ -73,7 +73,7 @@ public class CustomChat { .replace("MESSAGE", sanitizedMessage.replaceAll("&.", "")) // TODO: make this not use regex .replace(randomized, "MESSAGE"); // ohio ohio - CommandCore.INSTANCE.run("minecraft:tellraw @a " + sanitizedFormat); + CommandCore.INSTANCE.run((KaboomCheck.INSTANCE.isKaboom ? "minecraft:tellraw @a " : "tellraw @a ") + sanitizedFormat); } catch (Exception e) { if (client.player == null) return; client.player.sendMessage(Component.text(e.toString()).color(NamedTextColor.RED));