Skip to content

fix: gate compat mixins on mixin class name, not target class name - #23

Open
Febreeze-sys wants to merge 1 commit into
lhwdev:1.21from
Febreeze-sys:fix-compat-mixin-gating
Open

fix: gate compat mixins on mixin class name, not target class name#23
Febreeze-sys wants to merge 1 commit into
lhwdev:1.21from
Febreeze-sys:fix-compat-mixin-gating

Conversation

@Febreeze-sys

@Febreeze-sys Febreeze-sys commented Aug 29, 2026

Copy link
Copy Markdown

Problem

MixinPlugin.shouldApplyMixin checks targetClassName for the compat. package segment, but that segment only exists in mixinClassName. The condition is therefore never true, the CompatMods.loaded gate never runs, and compat mixins are applied unconditionally.

Without Steam 'n' Rails installed, compat.railways.flexiTrack.TrackTargetingBlockItemMixin targets a Create class and fails to attach on CREdgePointTypes.COUPLER. That takes Create down with it and crashes the game during mod loading:

Attach error for railx.mixins.json:compat.railways.flexiTrack.TrackTargetingBlockItemMixin
  from mod railx during activity: [... GETSTATIC ->
  com/railwayteam/railways/registry/CREdgePointTypes::COUPLER ...]
Caused by: java.lang.ClassNotFoundException:
  com.railwayteam.railways.registry.CREdgePointTypes

Fix

Changed the three targetClassName references inside the compat. branch to mixinClassName. The rest of the logic already matches — the package segment (railways) is identical to the mod id in CompatMods.loaded.

Testing

MC 1.21.1 / NeoForge 21.1.248 / Create 6.0.10, RailX 0.2.0-build.14, without Steam 'n' Rails installed. Game crashed on startup before the change, loads fine after.

EDIT: i tried to start the mod with Steam 'n' Rails installed and it crashed either btw.

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