promotional bannermobile promotional banner

sodium veil fix

A temporary patch mod that fixes the incompatibility issue between Sodium 0.8.14 beta and Veil.

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:

  1. Sodium 0.8.14-beta.1 prefixed its mixin members with sodium$ (PR #3955). ModelQuadView.getTexV became ModelQuadView.sodium$getTexV, and the same for getFaceNormal, getTexU, getSprite, …
  2. 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.
  3. Veil's mixin config is "required": true with "injectors": { "defaultRequire": 1 }, so a missed injection point is a hard crash rather than a warning.
  4. DefaultFluidRenderer is 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:

  1. 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
  2. Restore the legacy names on the interface, but only if Sodium actually renamed them: default methods getTexV(int) and getFaceNormal() delegating to their sodium$* counterparts. The getFaceNormal alias 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

sodium veil fix Team

profile avatar
  • 4
    Projects
  • 797
    Downloads

More from ShiratoriOri

  • Sable's crab trap project image

    Sable's crab trap

    Make the Crabber's Delight crab trap correctly recognise the water of the world when it sits on a Sable sub-level.

    • 12
    • November 27, 2026
  • simcoasters fix project image

    simcoasters fix

    Create: Coasters Simulated 0.1.6 fixed the performance issues upstream, so this mod now contains only the Sable Photomancy blueprint compatibility.

    • 422
    • November 27, 2026
  • sable costfix project image

    sable costfix

    Fixed the save-loading hang caused by Sable and copyfoxies.

    • 125
    • November 19, 2026
  • Sable's crab trap project image

    Sable's crab trap

    Make the Crabber's Delight crab trap correctly recognise the water of the world when it sits on a Sable sub-level.

    • 12
    • November 27, 2026
  • simcoasters fix project image

    simcoasters fix

    Create: Coasters Simulated 0.1.6 fixed the performance issues upstream, so this mod now contains only the Sable Photomancy blueprint compatibility.

    • 422
    • November 27, 2026
  • sable costfix project image

    sable costfix

    Fixed the save-loading hang caused by Sable and copyfoxies.

    • 125
    • November 19, 2026