Skip to content

Commit

Permalink
Showing 2 changed files with 19 additions and 24 deletions.
42 changes: 18 additions & 24 deletions src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java
Original file line number Diff line number Diff line change
@@ -7,9 +7,7 @@
*/
package net.wurstclient.mixin;

import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -27,32 +25,28 @@
@Mixin(BackgroundRenderer.class)
public abstract class BackgroundRendererMixin
{
@Shadow
@Nullable
protected static StatusEffectFogModifier getFogModifier(Entity entity,
float tickDelta)
{
return null;
}

@Inject(at = @At("HEAD"), method = "applyFog")
/**
* Makes the distance fog 100% transparent when NoFog is enabled,
* effectively removing it.
*/
@Inject(at = @At("HEAD"),
method = "applyFog(Lnet/minecraft/client/render/Camera;Lnet/minecraft/client/render/BackgroundRenderer$FogType;FZF)V")
private static void onApplyFog(Camera camera,
BackgroundRenderer.FogType fogType, float viewDistance,
boolean thickFog, float tickDelta, CallbackInfo ci)
{
if(WurstClient.INSTANCE.getHax().noFogHack.isEnabled())
{
CameraSubmersionType cameraSubmersionType =
camera.getSubmersionType();

Entity entity = camera.getFocusedEntity();
BackgroundRenderer.StatusEffectFogModifier statusEffectFogModifier =
getFogModifier(entity, tickDelta);

if(cameraSubmersionType == CameraSubmersionType.NONE
&& statusEffectFogModifier == null)
RenderSystem.setShaderFogColor(0, 0, 0, 0);
}
if(!WurstClient.INSTANCE.getHax().noFogHack.isEnabled())
return;

CameraSubmersionType cameraSubmersionType = camera.getSubmersionType();
if(cameraSubmersionType != CameraSubmersionType.NONE)
return;

Entity entity = camera.getFocusedEntity();
if(BackgroundRenderer.getFogModifier(entity, tickDelta) != null)
return;

RenderSystem.setShaderFogColor(0, 0, 0, 0);
}

@Inject(at = @At("HEAD"),
1 change: 1 addition & 0 deletions src/main/resources/wurst.accesswidener
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
accessWidener v1 named
accessible class net/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier
accessible method net/minecraft/client/MinecraftClient doItemUse ()V
accessible method net/minecraft/client/render/BackgroundRenderer getFogModifier (Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;
accessible method net/minecraft/client/render/GameRenderer loadPostProcessor (Lnet/minecraft/util/Identifier;)V
accessible method net/minecraft/entity/projectile/FishingBobberEntity isOpenOrWaterAround (Lnet/minecraft/util/math/BlockPos;)Z
accessible field net/minecraft/client/MinecraftClient itemUseCooldown I

0 comments on commit 1bb7dbe

Please sign in to comment.