Skip to content

Commit

Permalink
Fix AntiBlind only partially preventing the darkness effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Aug 1, 2024
1 parent 7878c65 commit 342ea6c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/wurstclient/hacks/AntiBlindHack.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public AntiBlindHack()
setCategory(Category.RENDER);
}

// See BackgroundRendererMixin, WorldRendererMixin,
// ClientPlayerEntityMixin.hasStatusEffect()
// See BackgroundRendererMixin, LightmapTextureManagerMixin,
// WorldRendererMixin, ClientPlayerEntityMixin.hasStatusEffect()
}
Original file line number Diff line number Diff line change
@@ -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<Float> cir)
{
if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled())
cir.setReturnValue(0F);
}
}
1 change: 1 addition & 0 deletions src/main/resources/wurst.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"KeyBindingMixin",
"KeyboardMixin",
"LanguageManagerMixin",
"LightmapTextureManagerMixin",
"LivingEntityRendererMixin",
"MinecraftClientMixin",
"MobEntityRendererMixin",
Expand Down

0 comments on commit 342ea6c

Please sign in to comment.