diff --git a/src/main/java/net/wurstclient/hacks/AntiBlindHack.java b/src/main/java/net/wurstclient/hacks/AntiBlindHack.java index b0b8218cbd..30082ea99f 100644 --- a/src/main/java/net/wurstclient/hacks/AntiBlindHack.java +++ b/src/main/java/net/wurstclient/hacks/AntiBlindHack.java @@ -23,6 +23,6 @@ public AntiBlindHack() setCategory(Category.RENDER); } - // See BackgroundRendererMixin, WorldRendererMixin, - // ClientPlayerEntityMixin.hasStatusEffect() + // See BackgroundRendererMixin, LightmapTextureManagerMixin, + // WorldRendererMixin, ClientPlayerEntityMixin.hasStatusEffect() } diff --git a/src/main/java/net/wurstclient/mixin/LightmapTextureManagerMixin.java b/src/main/java/net/wurstclient/mixin/LightmapTextureManagerMixin.java new file mode 100644 index 0000000000..3174f6d2ea --- /dev/null +++ b/src/main/java/net/wurstclient/mixin/LightmapTextureManagerMixin.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014-2024 Wurst-Imperium and contributors. + * + * This source code is subject to the terms of the GNU General Public + * License, version 3. If a copy of the GPL was not distributed with this + * file, You can obtain one at: https://www.gnu.org/licenses/gpl-3.0.txt + */ +package net.wurstclient.mixin; + +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.CallbackInfoReturnable; + +import net.minecraft.client.render.LightmapTextureManager; +import net.wurstclient.WurstClient; + +@Mixin(LightmapTextureManager.class) +public class LightmapTextureManagerMixin +{ + /** + * Stops the other darkness effect in caves when AntiBlind is enabled. + */ + @Inject(at = @At("HEAD"), + method = "getDarknessFactor(F)F", + cancellable = true) + private void onGetDarknessFactor(float delta, + CallbackInfoReturnable cir) + { + if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled()) + cir.setReturnValue(0F); + } +} diff --git a/src/main/resources/wurst.mixins.json b/src/main/resources/wurst.mixins.json index 635bbe9e94..d98d0cda19 100644 --- a/src/main/resources/wurst.mixins.json +++ b/src/main/resources/wurst.mixins.json @@ -42,6 +42,7 @@ "KeyBindingMixin", "KeyboardMixin", "LanguageManagerMixin", + "LightmapTextureManagerMixin", "LivingEntityRendererMixin", "MinecraftClientMixin", "MobEntityRendererMixin",