Core followups (#1445)

This commit is contained in:
Jason Mitchell authored and GitHub committed 2026-03-05 11:35:05 -08:00
1 parent 2fecb3a05b
commit 379330f997
14 files changed
+135 -82

No files matched your search

@@ -239,4 +239,15 @@ public class AngelicaConfig {
@Config.DefaultBoolean(true)
public static boolean replaceFFPUploads;
@Config.Comment("Pinned OpenGL version an integer (e.g. 46, 41, 33). 0 = auto-detect. [33, 46]. (Disable with disableGLVersionPinning=true)")
@Config.DefaultInt(0)
@Config.RangeInt(min = 0, max = 46)
@Config.RequiresMcRestart
public static int pinnedGLVersion;
@Config.Comment("Disable automatic GL version pinning. When true, always probes from highest on every launch.")
@Config.DefaultBoolean(false)
@Config.RequiresMcRestart
public static boolean disableGLVersionPinning;
}
@@ -1537,6 +1537,7 @@ public class GLStateManager {
}
}
alphaTest.enable();
fragmentGeneration++;
}
public static void disableAlphaTest() {
@@ -1554,6 +1555,7 @@ public class GLStateManager {
}
}
alphaTest.disable();
fragmentGeneration++;
}
public static void glAlphaFunc(int function, float reference) {
@@ -6,7 +6,9 @@ import net.minecraft.launchwrapper.Launch;
import net.minecraft.launchwrapper.LaunchClassLoader;
import java.io.File;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Set;
public class AngelicaLateTweaker implements ITweaker {
@@ -17,7 +19,41 @@ public class AngelicaLateTweaker implements ITweaker {
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader) {
// no-op
narrowTransformerExclusions(classLoader);
}
/**
* Reduces overly broad transformer exclusions that prevent AngelicaRedirector from doing its job.
*
* Looking at you, DragonAPI.
*/
@SuppressWarnings("unchecked")
private static void narrowTransformerExclusions(LaunchClassLoader classLoader) {
try {
final Field exceptionsField = LaunchClassLoader.class.getDeclaredField("transformerExceptions");
exceptionsField.setAccessible(true);
final Set<String> exceptions = (Set<String>) exceptionsField.get(classLoader);
if (exceptions.remove("Reika.DragonAPI.ASM")) {
// Don't read ASMCallsClient and Patchers/Fixes/WorldRenderAlpha. The rest are fair game.
// Re-add the other non utility classes
exceptions.add("Reika.DragonAPI.ASM.Patchers");
exceptions.add("Reika.DragonAPI.ASM.Profiling");
exceptions.add("Reika.DragonAPI.ASM.APIStripper");
exceptions.add("Reika.DragonAPI.ASM.ClassReparenter");
exceptions.add("Reika.DragonAPI.ASM.DependentMethodStripper");
exceptions.add("Reika.DragonAPI.ASM.DragonAPIClassTransformer");
exceptions.add("Reika.DragonAPI.ASM.FMLItemBlockPatch");
exceptions.add("Reika.DragonAPI.ASM.FluidNamePatch");
exceptions.add("Reika.DragonAPI.ASM.InterfaceInjector");
exceptions.add("Reika.DragonAPI.ASM.SpecialBiomePlacement");
exceptions.add("Reika.DragonAPI.ASM.StructureLootHooks");
FMLRelaunchLog.info("[Angelica] Narrowed Reika.DragonAPI.ASM transformer exclusion to allow GL redirection of utility classes");
}
} catch (Exception e) {
FMLRelaunchLog.warning("[Angelica] Failed to narrow transformer exclusions: %s", e.getMessage());
}
}
@Override