-
-
Notifications
You must be signed in to change notification settings - Fork 192
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
Using ModifyArgs causes a "ClassNotFoundException" under ModLauncher 9 #584
Comments
This is a known bug with Forge 1.17+ and is not a bug with mixin |
yep fully aware (discord) |
Just to clarify, from what I understand this NOT a Forge bug. But more an issue with Mixin and JPMS. These synthetic accessor classes need to be in the module that they are mixing into. Instead of trying to be defined in Mixin's module. As that entire module does not go through transformers and thus can't have dynamic code. The other potential solution is to manually define the class in the correct classloader yourself. But it probably would just be easier to change the package. |
@LexManos might be the case or might be not the case, that is for you and @Mumfrey to figure out. But my suggestion would be: Either implement a compiler warning that straight out disables that feature or actually fix the issue, whoever causes it. |
There's a solution long discussed and planned in McModLauncher/modlauncher#90, with a PR in McModLauncher/modlauncher#110 -it's already been figured out, just needs people to have time to review & implement. you're welcome to help out if you want things to improve. |
Well this solves some of it, but Lexes argument still holds. |
The reason it generates the args classes in a central package instead of in the target package is that args classes are shared and aren't target-specific. For example an If they need to be generated somewhere else then that's doable, but generating them in the same package as the first target doesn't make particular sense either.
I don't really get what you mean by this since JPMS doesn't know whether the classes are loaded off disk or generated at runtime. As far as I can see this should be a perfectly valid operation in JPMS-land like it was pre-JPMS. |
The problem is that two modules can not have classes in the same package. That violates JPMS. |
Yes that but not that package. It should be a package specific to that mod because the likelyhood of classes with anything else is to high. And that would make sense since the Class is loaded only if the mod is loaded anyways. |
There are no other classes in that package,
I don't get to pick the module, that part is handled by modlauncher.
I already said this above, Args classes are not mod-specific, they are shared. |
You can not use your Mixin package, it is part of your Mixin module which is not loaded into the game layer but into the plugins layer. If you want it to work no matter what with a single package, but ML basically requires you to pick something under net.minecraft. You could inject a "helper" mod with its own root package and use that as package for it, but it as long as it gets loaded into the right layer. |
@Mumfrey here is a question. How are the classnames generated for the Args class? Assuming it is a counter what happens if 2 mods provide "Args$1" class into sponges mixin directory but have 2 completely different arguments. Wouldn't that cause problems? This is what i mean with "Clashing" |
Opened because i am kinda interested in the inner workings and this doesn't look like a third party issue IMO. |
Yes they're just generated in the order that they're disccovered.
This is what I've said already,
Yes but your understanding somewhere is faulty because this statement: "mods provide "Args$1" class into sponges mixin directory" doesn't make any sense in the first place: mods do not "provide" anything, the classes are generated by Mixin.
|
Nope this explains for me everything that I didn't fully know and only assumed. My assumption was that the classes were generated on build and not in runtime. Thank you for explaining the extra info. |
see SpongePowered/Mixin#584 also splits 1.19.3 version for MinecraftClient for neater look
o/ so its offical too, I tried using ModifyArgs to replace values in a constructor.
While it was working on startup when the code changed started to be accessed it caused a "ClassNotFoundException"
Here is the mixin being used
I am using the forge beta for 1.19 mappings should be visible through the crashlog.
The text was updated successfully, but these errors were encountered: