Skip to content

Fix NeoForge shader crash with Iris/other shader mods#111

Closed
drolevar wants to merge 1 commit intoCorosauce:1.21.0from
drolevar:fix/neoforge-shader-registration
Closed

Fix NeoForge shader crash with Iris/other shader mods#111
drolevar wants to merge 1 commit intoCorosauce:1.21.0from
drolevar:fix/neoforge-shader-registration

Conversation

@drolevar
Copy link
Copy Markdown

Summary

  • Replace GameRendererReloadShaders mixin with RegisterShadersEvent for shader registration on NeoForge
  • Fix ShaderInstanceBlur to use NeoForge's ResourceLocation super constructor directly
  • Remove unused mixin entry from watut.mixins.json

Problem

On NeoForge 1.21.1, the game crashes on startup with:

FileNotFoundException: minecraft:shaders/core/particle.json

The GameRendererReloadShaders mixin injects at the end of reloadShaders, but the ResourceProvider passed to that method does not include mod resources. The custom getResourceFactory wrapper attempts to redirect lookups from minecraft: to watut: namespace, but neither the provider nor the global resource manager can resolve watut: resources at that point.

Fix

Use NeoForge's RegisterShadersEvent instead of a mixin. This is the standard approach used by other mods that ship custom shaders (Create, Mekanism, Alex's Caves, Twilight Forest, etc.). The event provides a ResourceProvider that includes all mod resources, so shaders under assets/watut/shaders/core/ are found correctly.

Testing

Tested with a 219-mod NeoForge 1.21.1 modpack including Iris, Sodium, and many mods with GameRenderer mixins. Game launches and loads successfully.

🤖 Generated with Claude Code

The GameRendererReloadShaders mixin crashed on NeoForge 1.21.1 because
the ResourceProvider passed to reloadShaders does not include mod
resources, causing FileNotFoundException for watut:shaders/core/particle.json.

Replace the mixin with NeoForge's RegisterShadersEvent, which provides
a ResourceProvider that includes all mod resources. This is the standard
approach used by other mods (Create, Mekanism, Alex's Caves, etc.).

Also fix ShaderInstanceBlur to call the ResourceLocation super constructor
directly instead of converting to String.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Read CONTRIBUTING.md

@github-actions github-actions bot closed this Mar 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant