mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-19 17:02:13 +02:00
Fix AntiBlind only partially preventing the darkness effect
Fixes https://wurstforum.net/d/688
This commit is contained in:
parent
7878c65ebb
commit
342ea6c1b1
@ -23,6 +23,6 @@ public final class AntiBlindHack extends Hack
|
||||
setCategory(Category.RENDER);
|
||||
}
|
||||
|
||||
// See BackgroundRendererMixin, WorldRendererMixin,
|
||||
// ClientPlayerEntityMixin.hasStatusEffect()
|
||||
// See BackgroundRendererMixin, LightmapTextureManagerMixin,
|
||||
// WorldRendererMixin, ClientPlayerEntityMixin.hasStatusEffect()
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -42,6 +42,7 @@
|
||||
"KeyBindingMixin",
|
||||
"KeyboardMixin",
|
||||
"LanguageManagerMixin",
|
||||
"LightmapTextureManagerMixin",
|
||||
"LivingEntityRendererMixin",
|
||||
"MinecraftClientMixin",
|
||||
"MobEntityRendererMixin",
|
||||
|
Loading…
Reference in New Issue
Block a user