Re-enable lighting after rendering Thaumcraft aspects

This commit is contained in:
Darren Eberly authored and Jason Mitchell committed 2023-12-30 15:02:29 -08:00
1 parent 46164ebac7
commit 20ae68aa62
2 files changed
+29

No files matched your search

@@ -42,6 +42,13 @@ public enum Mixins {
"angelica.debug.MixinSplashProgress"
)
),
ANGELICA_THAUMCRAFT_COMPAT(new Builder("Angelica Thaumcraft Compat").addTargetedMod(TargetedMod.THAUMCRAFT).setSide(Side.CLIENT)
.setPhase(Phase.EARLY).addMixinClasses(
"angelica.thaumcraft.MixinClientTickEventsFML"
)
),
// Not compatible with the lwjgl debug callbacks, so disable if that's enabled
ARCHAIC_SPLASH(new Builder("ArchaicFix Splash").addTargetedMod(TargetedMod.VANILLA).setSide(Side.CLIENT)
.setPhase(Phase.EARLY).setApplyIf(() -> AngelicaConfig.showSplashMemoryBar && !AngelicaMod.lwjglDebug).addMixinClasses(
@@ -0,0 +1,22 @@
package com.gtnewhorizons.angelica.mixins.early.angelica.thaumcraft;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import thaumcraft.client.lib.ClientTickEventsFML;
@Mixin(ClientTickEventsFML.class)
public class MixinClientTickEventsFML {
/**
* Thaumcraft disables lighting and only re-enables it if actually drawing an aspect(hovering over an item that
* you can see the aspect for and draws it). This shoves in a lighting re-enable at the end so that it is always
* re-enabled regardless.
*/
@Inject(method = "renderAspectsInGui", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/GL11;glPopAttrib()V"), remap = false)
private void angelica$lightingFix(CallbackInfo ci) {
GL11.glEnable(GL11.GL_LIGHTING);
}
}