-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
LWTS does not seem to work with liteloader #2
Comments
So, this got more confusing. It is not related to liteloader. I stripped out basically all of the liteloader code, and tried with vanillagradle (both client and server). I also tried with forge, same issue. Here's the same project, set up with vanillagradle (server): lwts-test-2.zip. Some debugging has gotten me down to this line of launchwrapper. final Class<?> clazz = Class.forName(launchTarget, false, classLoader); For some reason, that is inexplicable to me, on sponge this actually does use the classLoader instance passed in while for me it is using the default class loader (verified using the debugger). I have no clue why. And it's not that the class has already been loaded or something; I tried with It seems to be that that line is behaving differently on sponge for no discernable reason... |
This is the problem: https://github.com/Mojang/LegacyLauncher/blob/master/src/main/java/net/minecraft/launchwrapper/Launch.java#L97 Launchwrapper automatically adds a classloader exclusion for the package your tweaker is in. You need to put it into a separate package so This is also what's different for Sponge: We have the tweaker in a separate |
Ah, makes sense. Confirmed that that fixes my test program, and it should also fix my actual larger program. Thanks! |
As per SpongePowered/LaunchWrapperTestSuite#2, the tweaker must be in a different package. I also needed to add the java6 mixin code to my classpath for things to work, and have added the generated .mixin.out folders to my .gitignore.
"Launchwrapper automatically adds a classloader exclusion for the package your tweaker is in." See SpongePowered/LaunchWrapperTestSuite#2
When I run unit tests with liteloader, things do not work; it seems like the mixins are not being properly applied.
Here is the test output:
Here's a zip of my test project (which is just the liteloader examplemod plus some other code that works with tests; the mixin I'm testing is only for this and doesn't actually have any value when launched with MC). lwts-test.zip
LWTS does work on sponge on my machine. I added
System.out.println(this.getClass().getClassLoader())
toTestTweaker
andCatalogTypeClassesTest
(the second was just randomly chosen as one of the tests that uses LWTS), and forTestTweaker
it wassun.misc.Launcher$AppClassLoader@73d16e93
but forCatalogTypeClassesTest
it wasnet.minecraft.launchwrapper.LaunchClassLoader@30f10695
. This differs from my liteloader result, where both wereAppClassLoader
(see log above). I'm guessing that that is the reason why I'm getting non-mixed-in classes... but I have no clue why this is happening otherwise.I'm running with gradle wrapper 4.4.1.
The text was updated successfully, but these errors were encountered: