diff --git a/fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/SizePrependerMixin.java b/fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/SizePrependerMixin.java new file mode 100644 index 0000000..507c108 --- /dev/null +++ b/fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/SizePrependerMixin.java @@ -0,0 +1,14 @@ +package net.tonimatasdev.packetfixerfabric.mixin; + +import net.minecraft.network.SizePrepender; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(SizePrepender.class) +public class SizePrependerMixin { + @ModifyConstant(method = "encode(Lio/netty/channel/ChannelHandlerContext;Lio/netty/buffer/ByteBuf;Lio/netty/buffer/ByteBuf;)V", constant = @Constant(intValue = 3)) + private int newSize(int value) { + return 8; + } +} diff --git a/fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/SplitterHandlerMixin.java b/fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/SplitterHandlerMixin.java new file mode 100644 index 0000000..c4e4ac3 --- /dev/null +++ b/fabric/src/main/java/net/tonimatasdev/packetfixerfabric/mixin/SplitterHandlerMixin.java @@ -0,0 +1,14 @@ +package net.tonimatasdev.packetfixerfabric.mixin; + +import net.minecraft.network.SplitterHandler; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.Constant; +import org.spongepowered.asm.mixin.injection.ModifyConstant; + +@Mixin(SplitterHandler.class) +public class SplitterHandlerMixin { + @ModifyConstant(method = "decode(Lio/netty/channel/ChannelHandlerContext;Lio/netty/buffer/ByteBuf;Ljava/util/List;)V", constant = @Constant(intValue = 3)) + private int newSize(int value) { + return 8; + } +} diff --git a/fabric/src/main/resources/packetfixer.mixins.json b/fabric/src/main/resources/packetfixer.mixins.json index 37de13a..6b91606 100644 --- a/fabric/src/main/resources/packetfixer.mixins.json +++ b/fabric/src/main/resources/packetfixer.mixins.json @@ -12,6 +12,8 @@ "NbtTagSizeTrackerMixin", "PacketEncoderMixin", "PacketInflaterMixin", + "SizePrependerMixin", + "SplitterHandlerMixin", "compat.connectivity.PacketInflaterMixin", "compat.immersiveportals.CustomPayloadS2CPacketMixin" ],