mirror of
https://github.com/Wurst-Imperium/Wurst7.git
synced 2024-09-20 01:12:13 +02:00
Merge #904 (NoFog hack)
This commit is contained in:
commit
a764953ddf
@ -134,6 +134,7 @@ public final class HackList implements UpdateListener
|
||||
public final NoClipHack noClipHack = new NoClipHack();
|
||||
public final NoFallHack noFallHack = new NoFallHack();
|
||||
public final NoFireOverlayHack noFireOverlayHack = new NoFireOverlayHack();
|
||||
public final NoFogHack noFogHack = new NoFogHack();
|
||||
public final NoHurtcamHack noHurtcamHack = new NoHurtcamHack();
|
||||
public final NoLevitationHack noLevitationHack = new NoLevitationHack();
|
||||
public final NoOverlayHack noOverlayHack = new NoOverlayHack();
|
||||
|
24
src/main/java/net/wurstclient/hacks/NoFogHack.java
Normal file
24
src/main/java/net/wurstclient/hacks/NoFogHack.java
Normal file
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* 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.hacks;
|
||||
|
||||
import net.wurstclient.Category;
|
||||
import net.wurstclient.SearchTags;
|
||||
import net.wurstclient.hack.Hack;
|
||||
|
||||
@SearchTags({"no fog", "AntiFog", "anti fog"})
|
||||
public final class NoFogHack extends Hack
|
||||
{
|
||||
public NoFogHack()
|
||||
{
|
||||
super("NoFog");
|
||||
setCategory(Category.RENDER);
|
||||
}
|
||||
|
||||
// See BackgroundRendererMixin
|
||||
}
|
@ -10,16 +10,45 @@ 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.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 class BackgroundRendererMixin
|
||||
public abstract class BackgroundRendererMixin
|
||||
{
|
||||
/**
|
||||
* 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())
|
||||
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"),
|
||||
method = "getFogModifier(Lnet/minecraft/entity/Entity;F)Lnet/minecraft/client/render/BackgroundRenderer$StatusEffectFogModifier;",
|
||||
cancellable = true)
|
||||
|
@ -115,6 +115,7 @@
|
||||
"description.wurst.hack.nocomcrash": "Lags and crashes servers using the Nocom exploit.\nDoes not work on Paper servers. Tested working on Vanilla, Spigot, and Fabric. Can be disabled by some AntiCheats.",
|
||||
"description.wurst.hack.nofall": "Protects you from fall damage.",
|
||||
"description.wurst.hack.nofireoverlay": "Blocks the overlay when you are on fire.\n\n§c§lWARNING:§r This can cause you to burn to death without noticing.",
|
||||
"description.wurst.hack.nofog": "Removes distance fog from the world.",
|
||||
"description.wurst.hack.nohurtcam": "Disables the shaking effect when you get hurt.",
|
||||
"description.wurst.hack.nolevitation": "Disables the levitation effect when you get hit by a Shulker.\n\n§c§lWARNING:§r You will fall if you activate this while the levitation effect is already active!",
|
||||
"description.wurst.hack.nooverlay": "Blocks the overlays of water and lava.",
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user