From 55e19ab3f1d308b62b11e36151eb6d44db49bbcd Mon Sep 17 00:00:00 2001 From: Aleksi Lassila Date: Fri, 17 Dec 2021 10:50:48 +0200 Subject: [PATCH] Fixed incorrect look packets being sent --- .../printer/mixin/ClientPlayNetworkHandlerMixin.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/me/aleksilassila/litematica/printer/mixin/ClientPlayNetworkHandlerMixin.java b/src/main/java/me/aleksilassila/litematica/printer/mixin/ClientPlayNetworkHandlerMixin.java index 8e3516983..fcbf5009a 100644 --- a/src/main/java/me/aleksilassila/litematica/printer/mixin/ClientPlayNetworkHandlerMixin.java +++ b/src/main/java/me/aleksilassila/litematica/printer/mixin/ClientPlayNetworkHandlerMixin.java @@ -7,6 +7,7 @@ import net.minecraft.network.ClientConnection; import net.minecraft.network.Packet; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -20,18 +21,16 @@ public class ClientPlayNetworkHandlerMixin { @Shadow private MinecraftClient client; - @Inject(method = "sendPacket", at = @At("HEAD")) - public void sendPacket(Packet packet, CallbackInfo ci) { + @Overwrite + public void sendPacket(Packet packet) { if (Implementation.isLookPacket(packet) && Printer.shouldBlockLookPackets()) { Packet positionOnlyPacket = Implementation.getMoveOnlyPacket(client.player, packet); if (positionOnlyPacket != null) { this.connection.send(positionOnlyPacket); } - - return; } else { - + this.connection.send(packet); } } }