owo Network Fix
Fixes the disconnect Failed to encode packet 'clientbound/minecraft:custom_payload' caused by [owo] Sided Packet Codec has not been unpacked on NeoForge 1.21.1.
Unofficial fix — not affiliated with Wisp Forest, owo-lib or Accessories.
The problem
You join a world or a server and get kicked right away with:
Internal Exception: io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:custom_payload'
Caused by: java.lang.RuntimeException: Failed encoding custom payload accessories:main:
java.lang.IllegalStateException: [owo] Sided Packet Codec has not been unpacked, issue has occured!
It usually shows up with Accessories (also bundled inside The Aether and other mods), but it can hit any mod that sends packets through owo-lib.
Why it happens
owo-lib registers its packets with a placeholder codec and swaps in the real one inside NeoForge's NetworkRegistry#getCodec, using a mixin that targets the 4th return of that method (ordinal = 3).
Newer NeoForge 21.1 builds (e.g. 21.1.262) added more return statements to that method. The 4th one is now a return null, so owo never swaps the codec. The placeholder is sent as-is and encoding fails.
The fix
A single mixin that unwraps owo's placeholder codec on every return of getCodec, whatever the NeoForge build.
- No hard dependency on owo-lib (uses reflection). Without owo it does nothing.
- No config, nothing to set up.
- When it works, your log shows:
[owonetfix] codec owo déballé pour … : correctif actif.
Installation
- Install on the client and the server.
- Minecraft 1.21.1, NeoForge 21.1.x.
- Works alongside owo-lib 0.12.15.x and Accessories 1.1.0 betas.
FAQ
Do I still need owo-lib? Yes. This mod only fixes it, it doesn't replace it.
Can I remove it once owo-lib is updated? Yes. If a future owo-lib release fixes its own mixin, this mod becomes harmless and you can remove it.
Modpacks? Yes, feel free to include it.