From 710622803917c82489cb7ca7e4fb55a5967eb75c Mon Sep 17 00:00:00 2001 From: Cloudy Date: Fri, 20 Nov 2026 15:02:42 +0700 Subject: [PATCH] fix criticals with killaura crash singleworld issue --- .../meteorclient/mixin/ConnectionMixin.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ConnectionMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ConnectionMixin.java index 64b8bbefb01..8e128e50fe9 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ConnectionMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ConnectionMixin.java @@ -30,9 +30,13 @@ import net.minecraft.network.protocol.PacketFlow; import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.protocol.game.ClientboundBundlePacket; +import net.minecraft.network.protocol.game.ServerboundClientTickEndPacket; +import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket; import net.minecraft.server.network.EventLoopGroupHolder; import org.jspecify.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -82,6 +86,26 @@ private void onSendPacketTail(Packet packet, @Nullable ChannelFutureListener MeteorClient.EVENT_BUS.post(new PacketEvent.Sent(packet, (Connection) (Object) this)); } + @Unique + private boolean sentPositionThisTick; + + @Inject(method = "doSendPacket(Lnet/minecraft/network/protocol/Packet;Lio/netty/channel/ChannelFutureListener;Z)V", at = @At("HEAD")) + private void onDoSendPacket(Packet packet, @Nullable ChannelFutureListener listener, boolean flush, CallbackInfo ci) { + if (packet instanceof ServerboundClientTickEndPacket) { + sentPositionThisTick = false; + return; + } + + if (!(packet instanceof ServerboundMovePlayerPacket move) || !move.hasPosition()) return; + + if (sentPositionThisTick) sendPacket(ServerboundClientTickEndPacket.INSTANCE, null, false); + + sentPositionThisTick = true; + } + + @Shadow + private void sendPacket(Packet packet, @Nullable ChannelFutureListener listener, boolean flush) {} + @Inject(method = "exceptionCaught", at = @At("HEAD"), cancellable = true) private void exceptionCaught(ChannelHandlerContext ctx, Throwable cause, CallbackInfo ci) { AntiPacketKick apk = Modules.get().get(AntiPacketKick.class);