Fix NeoForge shader crash with Iris/other shader mods#111
Closed
drolevar wants to merge 1 commit intoCorosauce:1.21.0from
Closed
Fix NeoForge shader crash with Iris/other shader mods#111drolevar wants to merge 1 commit intoCorosauce:1.21.0from
drolevar wants to merge 1 commit intoCorosauce:1.21.0from
Conversation
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>
|
Read CONTRIBUTING.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GameRendererReloadShadersmixin withRegisterShadersEventfor shader registration on NeoForgeShaderInstanceBlurto use NeoForge'sResourceLocationsuper constructor directlywatut.mixins.jsonProblem
On NeoForge 1.21.1, the game crashes on startup with:
The
GameRendererReloadShadersmixin injects at the end ofreloadShaders, but theResourceProviderpassed to that method does not include mod resources. The customgetResourceFactorywrapper attempts to redirect lookups fromminecraft:towatut:namespace, but neither the provider nor the global resource manager can resolvewatut:resources at that point.Fix
Use NeoForge's
RegisterShadersEventinstead 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 aResourceProviderthat includes all mod resources, so shaders underassets/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