The recipe serialization logic provided in the tutorial code for the custom recipe serializer causes a multiplayer synchronization error due to inconsistent reading/writing of ingredients over the network.
That's because in the toNetwork function, using pRecipe.getIngredients() results in an empty list. This leads to a network buffer mismatch and the following error during client connection:
io.netty.handler.codec.DecoderException: io.netty.handler,codec.Encoder.Exception: java.io.UTFDataFormatException: malformed input around byte 76
Confirmed that replacing pRecipe.getIngredients() with pRecipe.inputItems resolves the multiplayer sync issue.
The recipe serialization logic provided in the tutorial code for the custom recipe serializer causes a multiplayer synchronization error due to inconsistent reading/writing of ingredients over the network.
That's because in the toNetwork function, using pRecipe.getIngredients() results in an empty list. This leads to a network buffer mismatch and the following error during client connection:
io.netty.handler.codec.DecoderException: io.netty.handler,codec.Encoder.Exception: java.io.UTFDataFormatException: malformed input around byte 76
Confirmed that replacing pRecipe.getIngredients() with pRecipe.inputItems resolves the multiplayer sync issue.