Prefab

Prefab

14M Downloads

[Bug]: Internal Exception: io.netty.handler.codec.EncoderException:Failed to encode packet 'clientbound/minecraft:update_recipes'

ZephyrWindSpirit opened this issue ยท 6 comments

commented

Minecraft Version

1.21.1

Forge Version

21.1.132

Mod Version

1.0.2

Details

[20/03/2025 19:26:11 PM] [19:26:11] [Server thread/INFO] [minecraft/ServerGamePacketListenerImpl]: MINECRAFTUSERNAME lost connection: Internal Exception: io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:update_recipes'
https://mclo.gs/kFkBFC6
I appear to have corrupted my instance? Believes I'm in multiplayer but I'm not. I've had this issue since trying to connect to a public server with my extra mods installed (yes it was a bad idea). After that it also refuses to enter single player. The issue disappears if I remove the mod.
Extra mods: supplementaries, mmmmmmmmmm, prefab, abyssal decor, sparse structures, handcrafted, dusty decorations, dawn of time builder edition, yetanotherconfiglib, william wythers overhauled overworld, better brightness slider, travelers titles, trade cycling
Disabled mods: almost unified, crash assistant, justzoom, konkrete

Per someone else who can read reports, this was dug out of the mess.
Caused by: io.netty.handler.codec.EncoderException: Empty ItemStack not allowed
[21/03/2025 02:28:45 AM] at TRANSFORMER/[email protected]/net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:167) ~[client-1.21.1-20240808.144430-srg.jar%23455!/:?] {re:classloading}
[21/03/2025 02:28:45 AM] at TRANSFORMER/[email protected]/net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:155) ~[client-1.21.1-20240808.144430-srg.jar%23455!/:?] {re:classloading}
[21/03/2025 02:28:45 AM] at TRANSFORMER/[email protected]/com.prefab.recipe.ConditionedShapedRecipe$Serializer.toNetwork(ConditionedShapedRecipe.java:251) ~[prefab-neoforge-1.0.2.jar%23649!/:?] {re:classloading}

commented

Prefab's name may be in the list but that doesn't mean we are the cause. There are also a lot of other mods in your list so the same comment goes for them too. Looking at the log even I cannot tell which mod is causing the error.

Prefab works in isolation and mods interact in mysterious ways ๐Ÿ˜„ so your best bet would be to disable some mods and see if things work to work out which mod is the real culprit.

For the comment about the game thinking you are in multi-player but you are in a single-player world. That is one of the oddities of Minecraft in that every game is multi-player. This is why when you are playing in a single-player world you can open it up for a LAN connection and include people on your network to play with you. It's a neat little trick but it can be confusing for those that don't know about it.

commented

This happened on my server too. The server worked perfectly for some time but at some point after a restart, everyone that tried to connect were instantly kicked with the same error. Removed Prefab and it begun working again.
This was on the ATM10 modpack.

commented

Did the mod work after you readded Prefab later at some point? Did you update any other mod between running the server and when you did the restart which could be the culprit?

commented

Confirmed. the issue is caused by prefab. Removing prefab from an affected world allows me to rejoin that world.

It seems you have a recipe with an empty itemstack in it.

Caused by: io.netty.handler.codec.EncoderException: Empty ItemStack not allowed
at TRANSFORMER/[email protected]/net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:167) ~[client-1.21.1-20240808.144430-srg.jar%23420!/:?]
at TRANSFORMER/[email protected]/net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:155) ~[client-1.21.1-20240808.144430-srg.jar%23420!/:?]
at TRANSFORMER/[email protected]/com.prefab.recipe.ConditionedShapedRecipe$Serializer.toNetwork(ConditionedShapedRecipe.java:251) ~[prefab-neoforge-1.0.2.jar%23577!/:?]

https://gist.github.com/Moobien/0468d6f4dae05cc933e5a28f87e747a7

commented

@Kaiede Thank you for the details I have been asking for! This will help me narrow down the troubleshooting on my end considerably.

I will get working on this, this morning to duplicate with the mod provided and come up with an appropriate fix.

commented

As another data point, I hit this same "Empty Item Stack Not Allowed" error in a 1.21.1 modpack I've been piecing together for a private SMP.

In my case, it looks like some conflict with Hexerei 0.5.x and Prefab 1.x as they build recipes? Each are fine in isolation, and with the rest of the mods in the pack, but not together. If I try 1.0.1 it seems like I hit the crash that was called out in the fixes for 1.0.2, and the call stack also points towards a conflict with Hexerei.

EDIT: Can also confirm it reproduces with just Hexerei and Prefab installed (+ Cloth Config API dependency).