Skip to content

Commit

Permalink
Fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Dec 18, 2023
1 parent 28c6538 commit 61ef0da
Showing 1 changed file with 67 additions and 67 deletions.
134 changes: 67 additions & 67 deletions src/main/java/net/wurstclient/mixin/BackgroundRendererMixin.java
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
/*
* Copyright (c) 2014-2023 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.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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import com.mojang.blaze3d.systems.RenderSystem;

import net.minecraft.client.render.BackgroundRenderer;
import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.CameraSubmersionType;
import net.minecraft.entity.Entity;
import net.wurstclient.WurstClient;

@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")
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);
}
}

@Inject(at = @At("HEAD"),
method = "getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;",
cancellable = true)
private static void onGetFogModifier(Entity entity, float tickDelta,
CallbackInfoReturnable<StatusEffectFogModifier> ci)
{
if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled())
ci.setReturnValue(null);
}
}
/*
* Copyright (c) 2014-2023 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.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;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import com.mojang.blaze3d.systems.RenderSystem;

import net.minecraft.client.render.BackgroundRenderer;
import net.minecraft.client.render.BackgroundRenderer.StatusEffectFogModifier;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.CameraSubmersionType;
import net.minecraft.entity.Entity;
import net.wurstclient.WurstClient;

@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")
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);
}
}

@Inject(at = @At("HEAD"),
method = "getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;",
cancellable = true)
private static void onGetFogModifier(Entity entity, float tickDelta,
CallbackInfoReturnable<StatusEffectFogModifier> ci)
{
if(WurstClient.INSTANCE.getHax().antiBlindHack.isEnabled())
ci.setReturnValue(null);
}
}

0 comments on commit 61ef0da

Please sign in to comment.