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

MixinTargetAlreadyLoadedException is thrown regardless of the return value of shouldApplyMixin #122

Open
ishland opened this issue Dec 9, 2023 · 1 comment

Comments

@ishland
Copy link

ishland commented Dec 9, 2023

See ishland/EarlyLoadingScreen#1

It appears that Mixin is checking whether the class is loaded before calling shouldApplyMixin, causing this to happen:

for (Object target : this.readTargets(mixin)) {
DeclaredTarget declaredTarget = DeclaredTarget.of(target, this);
if (declaredTarget == null) {
continue;
}
if (tracker != null && tracker.isClassLoaded(declaredTarget.name) && !this.isReloading()) {
String message = String.format("Critical problem: %s target %s was loaded too early.", this, declaredTarget.name);
if (this.parent.isRequired()) {
throw new MixinTargetAlreadyLoadedException(this, message, declaredTarget.name);
}
this.logger.error(message);
}
if (this.shouldApplyMixin(ignorePlugin, declaredTarget.name)) {
declaredTargets.add(declaredTarget);
}
}

@LlamaLad7
Copy link
Collaborator

Early loading is a fairly critical problem anyway. Even if you don’t want to mix into that class someone else might want to. Nothing should ever be early loaded like that.

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

No branches or pull requests

2 participants