-
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
In ide, minecraft classes should be loaded with knot than java's default class loader #353
Comments
Were this the case no Mixins would be able to apply to them either... which would be a far bigger problem. Given Knot is the context class loader before mods are even discovered it's a little difficult to completely avoid loading classes through it, could do with actual reproduction cases/code to work out what is happening for sure. |
Maybe knot cannot find the class on classpath and just delegates to parent for the class, and the parent doesn't have pre-loading transformation hooks? That is a possibility. |
That would only happen if the Minecraft jar was split up into multiple jars, because Loader would only count the one with a |
Hmm, how did those classes escape into app classloader then? app should be the system class loader per https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/ClassLoader.html#getSystemClassLoader() |
That's why I suggested getting a reproduction case, you can artificially do it readily enough but the Yarn report appeared like it was accidental. |
Hmm, in my intellij idea IDE I can never run my mods (always only loader loaded, mods folder works normally), and I always use |
If you're running without Loader you'll definitely get these issues as any access problems are fixed by it at runtime (seemingly to avoid mods compiling to depend on them from Modmuss's responses to #352). In such contexts though it's not really Loom's problem given it is only catering for the expected use case that you're using Loader. |
@OroArmor do you have the full stacktrace of that illegal access error? |
If you want to run the data generator it has to go through loader/knot for a few reasons (AW's and mixins are 2), for now id recommend just calling the data generator from a client or a server mod. Getting loader setup to run data gen should be easy enough, but it would need to have a fabric api module to go with it. And even then id still suggest just calling it after a server has booted up and close gracefully once compelete to ensure mods are correctaly loaded. |
the problem now is not data gen. it's this access problem (in wrong classloader) happening under loader in dev env as seen in original yarn issue |
Then I need a way to reproduce it, or at the very least a full stacktrace to know how it was launched. |
No, it was someone else that encountered it. I just reported it |
We need that full stacktrace in order to find out how minecraft classes are loaded by the app classloader without knot sanitization. Can you help contacting? |
Sure give me a bit |
Not seen this for a while, please open a new issue if it still happens. |
See FabricMC/yarn#2057
(net.minecraft.world.gen.chunk.NoiseChunkGenerator and net.minecraft.world.gen.StructureWeightSampler are in unnamed module of loader 'app')
Afaik running in other circumstances, such as in gradle run task or in production all goes through fabric loader. This one doesn't and apparently causes some trouble as it bypasses loaders' access hacks.
The text was updated successfully, but these errors were encountered: