Veil Sodium Fix
Keeps Veil's Sodium compatibility mixins working on Sodium 0.8.14+, where Sodium renamed its quad accessors to sodium$*.
The problem it fixes
With Sodium 0.8.14-beta.1 or newer installed, the game does not crash at startup — it crashes the moment you enter a world, which makes it look like a world corruption or a broken chunk:
org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError:
An unexpected critical error was encountered
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError:
Critical injection failure: Callback method bufferNormal(...) in
veil.neoforge.mixins.json:compat.sodium.DefaultFluidRendererMixin from mod veil
failed injection check, (0/1) succeeded. Scanned 0 target(s). No refMap loaded.
The chain behind it:
- Sodium 0.8.14-beta.1 prefixed its mixin members with
sodium$(PR #3955).ModelQuadView.getTexVbecameModelQuadView.sodium$getTexV, and the same forgetFaceNormal,getTexU,getSprite, … - Veil 4.x locates its fluid-renderer injection point by the literal old name:
@At(value = "INVOKE", target = "…ModelQuadView;getTexV(I)F", remap = false). Since Veil's mixin JSON ships no refMap, that name is matched verbatim against the bytecode — and after the rename it matches zero instructions. - Veil's mixin config is
"required": truewith"injectors": { "defaultRequire": 1 }, so a missed injection point is a hard crash rather than a warning. DefaultFluidRendereris loaded lazily by Sodium when the level renderer initialises, which is why the failure surfaces at world join instead of at launch.
Veil 4.5.2 is the newest build for 1.21.1 (October 2026) and predates Sodium's rename, so there is nothing to update to — yet.
What this mod does
It does not patch or replace Veil. It rebuilds the injection point Sodium moved, using two zero-member "anchor" mixins that hand the target ClassNode to a plugin, which then edits bytecode directly during the mixin pre-apply phase:
-
Re-plant the lost call site in
DefaultFluidRenderer.writeQuad, once per vertex, right before the loop increment:代码块aload 5 // receiver: the quad iload 9 // vertex index invokeinterface ModelQuadView.getTexV(I)F pop // result discarded, net stack delta 0 -
Restore the legacy names on the interface, but only if Sodium actually renamed them: default methods
getTexV(int)andgetFaceNormal()delegating to theirsodium$*counterparts. ThegetFaceNormalalias is not optional — Veil's handler body is copied into the target class and calls it directly, so an injected callback would otherwise fail at runtime.
The result is not "suppress the crash": Veil injects exactly as it did on Sodium 0.8.13, and fluid vertices keep their per-vertex normals.
Everything is decided by inspecting the target class files, never by mod version strings, because the mixin config is prepared before FML's mod list exists. On Sodium 0.8.13 and older the mod is completely inert.
Requirements
| Minecraft | 1.21.1 |
| Loader | NeoForge 21.1.x |
| Side | Client only (no server component) |
| Veil | 4.3.2 or newer — 4.3.2 is the build jarjar'd inside Sable 2.0.6; tested with 4.5.2 |
| Sodium | 0.6.9+ declared; does anything only on 0.8.14-beta.1+, inert on older builds |

