Skip to content
This repository has been archived by the owner on Jul 6, 2024. It is now read-only.

Commit

Permalink
try fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Feb 18, 2024
1 parent bacf7cd commit a6353ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package net.fabricmc.fabric.mixin.networking;

import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.NetworkState;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -38,11 +40,11 @@ public class CustomPayloadC2SPacketMixin {
private static int MAX_PAYLOAD_SIZE;

@Inject(
method = "readPayload*",
method = "readPayload(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/NetworkState;)Lnet/minecraft/network/packet/CustomPayload;",
at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/common/CustomPayloadC2SPacket;readUnknownPayload(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;)Lnet/minecraft/network/packet/UnknownCustomPayload;"),
cancellable = true
)
private static void readPayload(Identifier id, PacketByteBuf buf, CallbackInfoReturnable<CustomPayload> cir) {
private static void readPayload(Identifier id, PacketByteBuf buf, ChannelHandlerContext context, NetworkState protocol, CallbackInfoReturnable<CustomPayload> cir) {
cir.setReturnValue(PayloadHelper.readCustom(id, buf, MAX_PAYLOAD_SIZE, NetworkingImpl.FACTORY_RETAIN.get()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package net.fabricmc.fabric.mixin.networking;

import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.NetworkState;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand All @@ -38,11 +40,11 @@ public class CustomPayloadS2CPacketMixin {
private static int MAX_PAYLOAD_SIZE;

@Inject(
method = "readPayload*",
method = "readPayload(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/NetworkState;)Lnet/minecraft/network/packet/CustomPayload;",
at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/s2c/common/CustomPayloadS2CPacket;readUnknownPayload(Lnet/minecraft/util/Identifier;Lnet/minecraft/network/PacketByteBuf;)Lnet/minecraft/network/packet/UnknownCustomPayload;"),
cancellable = true
)
private static void readPayload(Identifier id, PacketByteBuf buf, CallbackInfoReturnable<CustomPayload> cir) {
private static void readPayload(Identifier id, PacketByteBuf buf, ChannelHandlerContext context, NetworkState protocol, CallbackInfoReturnable<CustomPayload> cir) {
cir.setReturnValue(PayloadHelper.readCustom(id, buf, MAX_PAYLOAD_SIZE, NetworkingImpl.FACTORY_RETAIN.get()));
}
}

0 comments on commit a6353ed

Please sign in to comment.