Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework how MixinConstraints disable mixins. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Fox2Code
Copy link

@Fox2Code Fox2Code commented Mar 3, 2025

Allows to only call MixinConstraintsBootstrap.init(); once and have MixinConstraints work everywhere.

@Moulberry
Copy link
Owner

Moulberry commented Mar 4, 2025

shouldApplyMixin is called before the target class is attempted to be loaded.
This change causes the checks to happen after the target class is attempted to be loaded.

This results in the log being filled with ClassNotFoundErrors when using IfModLoaded annotations on a mod's class even when that mod isn't loaded.

See 7216691 for an example case.
Doing ./gradlew :testmod:fabricRunClient on this branch with the above commit causes the following log message to appear:
[main/WARN]: Error loading class: com/doesnt/exist/Main (java.lang.ClassNotFoundException: com/doesnt/exist/Main)

I am not sure if there's a workaround to get this approach to work without spamming errors in console.

Edit: the error originates from org.spongepowered.asm.mixin.transformer.ClassInfo#forName, not MixinConstraints, in case that wasn't clear.

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.

2 participants