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

ArchaicFix crashing on launch #95

Open
Crimento opened this issue Sep 8, 2022 · 5 comments
Open

ArchaicFix crashing on launch #95

Crimento opened this issue Sep 8, 2022 · 5 comments

Comments

@Crimento
Copy link

Crimento commented Sep 8, 2022

Hi Greg!
Just found this nice mod that fixing a lot of vanilla bugs and backports new lighting engine to 1.7.10

Sadly, it's crashing with GT6. Here is the log.
Not sure on which side it should be fixed so I opened an issue in both repos
embeddedt/ArchaicFix#28

https://pastebin.com/PBjqWHQx

@GregoriusT
Copy link
Member

Hrrm, that might need usage of the gregtech config to turn off specific pieces of ASM. There is an asm.ini File where you need to set this to false:
transformer:gregtech.asm.transformers.Minecraft_MinecraftServerIntegratedLaunchMainMenuPartialFix = false

@makamys
Copy link

makamys commented Sep 13, 2022

I already confirmed that disabling that option fixes the incompatibility. I explained the reason for this in embeddedt/ArchaicFix#28 (comment). Basically, you need to avoid loading additional classes in the transformer, since Mixin freaks out if a class tries to get transformed while another transformation is in progress.

@GregoriusT
Copy link
Member

GregoriusT commented Sep 13, 2022

Having read that comment on the other Thread, I am trying to wrap my head around where @OvermindDL1 is actually loading another Class in that particular thing. Any hints on which class it is?

Edit: Link for convenience

https://github.com/GregTech6/gregtech6/blob/master/src/main/java/gregtech/asm/transformers/Minecraft_MinecraftServerIntegratedLaunchMainMenuPartialFix.java

@makamys
Copy link

makamys commented Sep 13, 2022

It happens here.

c = Class.forName(type1.replace('/', '.'), false, classLoader);
d = Class.forName(type2.replace('/', '.'), false, classLoader);

What I would try to do is get the raw bytes by doing something like this instead:

byte[] classBytes1;
try(InputStream is = Minecraft_MinecraftServerIntegratedLaunchMainMenuPartialFix.class.getResourceAsStream("/" + type1 + ".class")) {
    classBytes1 = IOUtils.toByteArray(is);
}

And creating a ClassNode to parse the class bytes, getting its superclass and stuff. I think I saw a trick like this somewhere, but I can't remember where.

Though I'm not exactly sure why getCommonSuperClass is needed in the first place, this is just a spot fix.

@GregoriusT
Copy link
Member

Yeah I dont know either why exactly it is needed.

For now I will just comment out the partial fix since it doesn't work completely anyways. That should avoid Crashes in the future, until some proper fix was found, or at the very least is in a state where this Issue doesn't happen anymore.

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

3 participants