Fix Fabric crash on startup without game test API - #248
Merged
Merged
Conversation
Fabric API does not ship fabric-gametest-api-v1 in production, and Fabric Loader 0.19.4+ makes missing mixin targets fatal for mods that depend on it, so the game test mixin crashed on launch. Mark it as a pseudo mixin so it is skipped when the target is absent. Closes CyclopsMC/ColossalChests#213 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAW7gtK1CZ7WoHxTM81k9V
|
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.



Fixes CyclopsMC/ColossalChests#213 (the crash comes from CyclopsCore, not ColossalChests).
Cause
MixinFabricGameTestModInitializertargetsnet.fabricmc.fabric.impl.gametest.FabricGameTestModInitializer. That class is infabric-gametest-api-v1, which only exists in dev, not in the production Fabric API jar.This used to be only a warning. Fabric Loader 0.19.4 maps mods that depend on
fabricloader >=0.19.4to Mixin compatibility0.17.4. Under that level, a missing target in arequiredconfig throwsInvalidMixinException. Since the 26.3 update,master-26declaresfabricloader >=0.19.5, so the game now crashes on launch.master-26-lts(loader 0.18.5) is not affected.Fix
Mark the mixin
@Pseudoand reference the target by name, so it is skipped when the class is missing.Validation
:loader-fabric:buildpasses.@Mixin target ... was not foundcrash.:loader-fabric:runGameTestServer: all 2 required tests pass. They are registered only through this mixin, so it still applies in dev.🤖 Generated with Claude Code
https://claude.ai/code/session_01FAW7gtK1CZ7WoHxTM81k9V
Generated by Claude Code