-
-
Notifications
You must be signed in to change notification settings - Fork 421
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix AntiBlind only partially preventing the darkness effect
- Loading branch information
1 parent
7878c65
commit 342ea6c
Showing
3 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/net/wurstclient/mixin/LightmapTextureManagerMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters