Skip to content

Commit

Permalink
Fixed Criticals not working
Browse files Browse the repository at this point in the history
Possibly also fixed other weird packet behavior after 1.20.6 update
  • Loading branch information
tyrannus00 committed May 22, 2024
1 parent fa00a6d commit fedc293
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,9 @@ private static void onConnect(InetSocketAddress address, boolean useEpoll, Clien
}

@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<?>> packet) {
PacketEvent.Send processedPacket = MeteorClient.EVENT_BUS.post(PacketEvent.Send.get(packet.get()));
if (processedPacket.isCancelled()) {
private void onSendPacketHead(CallbackInfo info, @Local(argsOnly = true) Packet<?> packet) {
if (MeteorClient.EVENT_BUS.post(PacketEvent.Send.get(packet)).isCancelled()) {
info.cancel();
} else {
packet.set(processedPacket.packet);
}
}

Expand Down

0 comments on commit fedc293

Please sign in to comment.