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

Failing to launch, MixinTargetAlreadyLoadedException #388

Closed
5HT2 opened this issue Mar 8, 2020 · 7 comments
Closed

Failing to launch, MixinTargetAlreadyLoadedException #388

5HT2 opened this issue Mar 8, 2020 · 7 comments

Comments

@5HT2
Copy link

5HT2 commented Mar 8, 2020

If you try to launch the class-lookup branch of my repo, you'll get this error.

Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [mixins.kami.json:MixinAbstractClientPlayer] from phase [DEFAULT] in config [mixins.kami.json] FAILED during PREPARE
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTargetAlreadyLoadedException: Critical problem: mixins.kami.json:MixinAbstractClientPlayer target net.minecraft.client.entity.AbstractClientPlayer was already transformed.

You can clone it with git clone -b class-lookup https://github.com/S-B99/kamiblue and find instructions to setup a workspace here: https://blue.bella.wtf/contributing

The changed files can be found here :https://github.com/S-B99/kamiblue/pull/317/files

The only changes in Mixin related files is changing the class lookup manager, as you can see shown in the link but you can check for yourself.

I don't have duplicate @ Mixin annotations anywhere, nor duplicate mixin registers in mixins.kami.json

@Johni0702
Copy link

Not 100% sure if it's the issue as I don't see why it would only pop up with that PR but your coremod is loading your normal mod class and executing its static initializer (ref).
That'll cause anything in there to be loaded before Mixin is initialized and potentially (I am not particularly familiar with how forge sets up its classloaders) also cause those classes and anything they load to end up with the wrong classloader.

@5HT2
Copy link
Author

5HT2 commented Mar 9, 2020

I'm not quite sure how it works either, and something that changed in the pull had to have done it as it only happens there, but nothing mixin related changed.

Maybe the module lookup somehow tries to load a module before mixins? It shouldn't happen but it's possible, as from what I can tell modules are loaded even if mc.player is null (ie, modules load even when not loaded into a world) but I shouldn't have an issue from that, as the issue here is that a Mixin is already loaded when it tried loading it.

@Johni0702
Copy link

No, what I was trying to say is that loading non-coremod classes from your coremod is not allowed (i.e. once you do it, all bets are off) and the specific error you're getting would perfectly fit that.
I'm just not 100% sure because do not see exactly how those changes cause the AbstractClientPlayer class to get loaded prior to mixin being ready for it (maybe because I only skimmed them) but I would not at all be surprised if they did.
You should remove that line and try again.

@5HT2
Copy link
Author

5HT2 commented Mar 9, 2020

Which line exactly? You mean this diff? If so, it happens before I merged feature/master into it to fix the merge conflicts.
2020-03-09-101711_1920x1080_scrot

@Johni0702
Copy link

The one I linked in my first reply: https://github.com/S-B99/kamiblue/blob/cf3207db8845d7311a4eb230f247e3252667525b/src/main/java/me/zeroeightsix/kami/mixin/MixinLoaderForge.java#L16
And also the last line of the same method (i.e. any reference to the KamiMod class).

@5HT2
Copy link
Author

5HT2 commented Mar 9, 2020

Uh, that fixed it? I think?

@5HT2
Copy link
Author

5HT2 commented Mar 9, 2020

Yep, launched. Not 100% sure why that was the issue. Thanks!

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