GregTech6 / gregtech6

This is the Official Repository of the Mod GregTech 6 for Minecraft 1.7.10
https://gregtech.mechaenetia.com
Other
188 stars 53 forks source link

ArchaicFix crashing on launch #95

Open Crimento opened 2 years ago

Crimento commented 2 years ago

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 https://github.com/embeddedt/ArchaicFix/issues/28

https://pastebin.com/PBjqWHQx

GregoriusT commented 2 years ago

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 commented 2 years ago

I already confirmed that disabling that option fixes the incompatibility. I explained the reason for this in https://github.com/embeddedt/ArchaicFix/issues/28#issuecomment-1240405851. 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 commented 2 years ago

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 commented 2 years ago

It happens here. https://github.com/GregTech6/gregtech6/blob/c0710cc3450ade24623e730147bce4e2e4cc8788/src/main/java/gregtech/asm/transformers/Minecraft_MinecraftServerIntegratedLaunchMainMenuPartialFix.java#L93-L94 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 commented 2 years ago

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.