mitigation: very old forge will crash trying to load package name starting with "mod_"

Because of crummy regex
57be417b7c/common/cpw/mods/fml/common/Loader.java (L66)
Old forge will incorrectly load "mod_blahblah/yourclass.class" while
expecting a "yourclass.class" because package name started with "mod_".

Fixes https://github.com/AngelAuraMC/Amethyst-Android/issues/265
This commit is contained in:
tomikun
2026-05-28 21:11:22 +08:00
parent ffe4929211
commit 1f8bf59b0a
4 changed files with 6 additions and 5 deletions

View File

@@ -1 +1 @@
2be860186e97caa614b289022a73b9774adcb85b
85d29ace15034e70e12253a7b596e49bc1a207df

View File

@@ -1,10 +1,11 @@
package org.angelauramc.methodsInjectorAgent.mod_compatibility_injector;
package org.angelauramc.methodsInjectorAgent.mods_compatibility_injector;
// If you dare call this mod_compatibility_injector old forge will try to load you as a class from
// a mod. See https://github.com/MinecraftForge/FML/blob/57be417b7c29bb23e152f400752f68f33115915d/common/cpw/mods/fml/common/Loader.java#L66
// Do not name any package name that gets loaded into classpath starting with "mod_", case-sensitive
import java.lang.instrument.ClassFileTransformer;
import java.lang.instrument.Instrumentation;
import java.security.ProtectionDomain;
import org.angelauramc.methodsInjectorAgent.lwjgl2_methods_injector.ALC10Injector;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassVisitor;
import org.objectweb.asm.ClassWriter;

View File

@@ -2,7 +2,7 @@ package org.angelauramc.methodsInjectorAgent;
import org.angelauramc.methodsInjectorAgent.lwjgl2_methods_injector.ALC10Injector;
import org.angelauramc.methodsInjectorAgent.lwjgl2_methods_injector.ASM5OverrideInjector;
import org.angelauramc.methodsInjectorAgent.mod_compatibility_injector.VeilImguiOverrideDisable;
import org.angelauramc.methodsInjectorAgent.mods_compatibility_injector.VeilImguiOverrideDisable;
import java.lang.instrument.Instrumentation;