Fabric Loader: 0.16.9
Fabric API: 0.108.0+1.21.1
Hello, I've found a bit of an edge case with the class I mentioned in the title.
Whenever a custom ingredient is attempted to be synced, it will always fall back.
I think that this might be because of the current supported ingredients set being cleared unconditionally.
|
@Inject( |
|
at = { |
|
// Normal target after writing |
|
@At( |
|
value = "INVOKE", |
|
target = "Lnet/minecraft/network/codec/PacketCodec;encode(Ljava/lang/Object;Ljava/lang/Object;)V", |
|
shift = At.Shift.AFTER, |
|
by = 1 |
|
), |
|
// In the catch handler in case some exception was thrown |
|
@At( |
|
value = "INVOKE", |
|
target = "net/minecraft/network/packet/Packet.isWritingErrorSkippable()Z" |
|
) |
|
}, |
|
method = "encode(Lio/netty/channel/ChannelHandlerContext;Lnet/minecraft/network/packet/Packet;Lio/netty/buffer/ByteBuf;)V" |
|
) |
|
private void releasePacketEncoder(ChannelHandlerContext channelHandlerContext, Packet<?> packet, ByteBuf byteBuf, CallbackInfo ci) { |
|
CustomIngredientSync.CURRENT_SUPPORTED_INGREDIENTS.set(null); |
|
} |