diff --git a/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java b/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java index b959abbe97..9c6bb603fb 100644 --- a/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java +++ b/src/main/java/meteordevelopment/meteorclient/mixin/ClientConnectionMixin.java @@ -22,6 +22,7 @@ import meteordevelopment.meteorclient.systems.proxies.Proxy; import net.minecraft.network.ClientConnection; import net.minecraft.network.NetworkSide; +import net.minecraft.network.PacketCallbacks; import net.minecraft.network.handler.PacketEncoderException; import net.minecraft.network.handler.PacketSizeLogger; import net.minecraft.network.listener.ClientPlayPacketListener; @@ -30,6 +31,7 @@ import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -66,7 +68,7 @@ private static void onConnect(InetSocketAddress address, boolean useEpoll, Clien MeteorClient.EVENT_BUS.post(ServerConnectEndEvent.get(address)); } - @Inject(at = @At("HEAD"), method = "send(Lnet/minecraft/network/packet/Packet;)V", cancellable = true) + @Inject(at = @At("HEAD"), method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V", cancellable = true) private void onSendPacketHead(CallbackInfo info, @Local LocalRef> packet) { PacketEvent.Send processedPacket = MeteorClient.EVENT_BUS.post(PacketEvent.Send.get(packet.get())); if (processedPacket.isCancelled()) { @@ -76,8 +78,8 @@ private void onSendPacketHead(CallbackInfo info, @Local LocalRef> pack } } - @Inject(method = "send(Lnet/minecraft/network/packet/Packet;)V", at = @At("TAIL")) - private void onSendPacketTail(Packet packet, CallbackInfo info) { + @Inject(method = "send(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/PacketCallbacks;)V", at = @At("TAIL")) + private void onSendPacketTail(Packet packet, @Nullable PacketCallbacks callbacks, CallbackInfo ci) { MeteorClient.EVENT_BUS.post(PacketEvent.Sent.get(packet)); } diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/PacketCanceller.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/PacketCanceller.java index 219b9395c6..ba7a2c1f15 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/PacketCanceller.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/misc/PacketCanceller.java @@ -37,6 +37,7 @@ public class PacketCanceller extends Module { public PacketCanceller() { super(Categories.Misc, "packet-canceller", "Allows you to cancel certain packets."); + runInMainMenu = true; } @EventHandler(priority = EventPriority.HIGHEST + 1)