From 0f50937846e4d8b236e0ddbab7376927a7ede8e8 Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Sun, 28 May 2023 13:40:01 -0400 Subject: [PATCH 1/3] NoPortalOverlay --- .../java/net/wurstclient/hack/HackList.java | 1 + .../hacks/NoPortalOverlayHack.java | 24 +++++++++++++++++++ .../net/wurstclient/mixin/IngameHudMixin.java | 11 +++++++++ .../resources/assets/wurst/lang/en_us.json | 1 + 4 files changed, 37 insertions(+) create mode 100644 src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java diff --git a/src/main/java/net/wurstclient/hack/HackList.java b/src/main/java/net/wurstclient/hack/HackList.java index e55ca896dc..564c6af2b9 100644 --- a/src/main/java/net/wurstclient/hack/HackList.java +++ b/src/main/java/net/wurstclient/hack/HackList.java @@ -136,6 +136,7 @@ public final class HackList implements UpdateListener public final NoHurtcamHack noHurtcamHack = new NoHurtcamHack(); public final NoLevitationHack noLevitationHack = new NoLevitationHack(); public final NoOverlayHack noOverlayHack = new NoOverlayHack(); + public final NoPortalOverlayHack noPortalOverlayHack = new NoPortalOverlayHack(); public final NoPumpkinHack noPumpkinHack = new NoPumpkinHack(); public final NoSlowdownHack noSlowdownHack = new NoSlowdownHack(); public final NoWeatherHack noWeatherHack = new NoWeatherHack(); diff --git a/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java b/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java new file mode 100644 index 0000000000..dfce0f3905 --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java @@ -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 portal overlay"}) +public final class NoPortalOverlayHack extends Hack +{ + public NoPortalOverlayHack() + { + super("NoPortalOverlay"); + setCategory(Category.RENDER); + } + + // See IngameHudMixin.onRenderPortalOverlay() +} diff --git a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java index 5f43072f95..e900a42128 100644 --- a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java @@ -56,4 +56,15 @@ private void onRenderOverlay(MatrixStack matrixStack, Identifier identifier, ci.cancel(); } + + @Inject(at = @At("HEAD"), + method = "renderPortalOverlay(Lnet/minecraft/client/util/math/MatrixStack;F)V", + cancellable = true) + private void onRenderPortalOverlay(MatrixStack matrixStack, float nauseaStrength, CallbackInfo ci) + { + if(!WurstClient.INSTANCE.getHax().noPortalOverlayHack.isEnabled()) + return; + + ci.cancel(); + } } diff --git a/src/main/resources/assets/wurst/lang/en_us.json b/src/main/resources/assets/wurst/lang/en_us.json index 61a0142add..d7e0ac0ed9 100644 --- a/src/main/resources/assets/wurst/lang/en_us.json +++ b/src/main/resources/assets/wurst/lang/en_us.json @@ -117,6 +117,7 @@ "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.", + "description.wurst.hack.noportaloverlay": "Blocks the portal overlay when you stand in a portal.", "description.wurst.hack.nopumpkin": "Blocks the overlay when wearing a pumpkin on your head.", "description.wurst.hack.noslowdown": "Cancels slowness effects caused by honey, soul sand and using items.", "description.wurst.hack.noweather": "Allows you to alter the client-side weather, time and moon phase.", From ee3c2191ecbbf662158cbb6527a6f3c85638e7a2 Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Tue, 2 Jan 2024 13:31:58 -0500 Subject: [PATCH 2/3] Cleanup and fix --- .../java/net/wurstclient/hack/HackList.java | 3 +- .../hacks/NoPortalOverlayHack.java | 2 +- .../net/wurstclient/mixin/IngameHudMixin.java | 141 +++++++++--------- 3 files changed, 74 insertions(+), 72 deletions(-) diff --git a/src/main/java/net/wurstclient/hack/HackList.java b/src/main/java/net/wurstclient/hack/HackList.java index 110aa3d3a9..aeadb8ada6 100644 --- a/src/main/java/net/wurstclient/hack/HackList.java +++ b/src/main/java/net/wurstclient/hack/HackList.java @@ -138,7 +138,8 @@ public final class HackList implements UpdateListener public final NoHurtcamHack noHurtcamHack = new NoHurtcamHack(); public final NoLevitationHack noLevitationHack = new NoLevitationHack(); public final NoOverlayHack noOverlayHack = new NoOverlayHack(); - public final NoPortalOverlayHack noPortalOverlayHack = new NoPortalOverlayHack(); + public final NoPortalOverlayHack noPortalOverlayHack = + new NoPortalOverlayHack(); public final NoPumpkinHack noPumpkinHack = new NoPumpkinHack(); public final NoShieldOverlayHack noShieldOverlayHack = new NoShieldOverlayHack(); diff --git a/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java b/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java index dfce0f3905..1c4d502d63 100644 --- a/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java +++ b/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java @@ -19,6 +19,6 @@ public NoPortalOverlayHack() super("NoPortalOverlay"); setCategory(Category.RENDER); } - + // See IngameHudMixin.onRenderPortalOverlay() } diff --git a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java index 2d4a855808..bd96cc63bf 100644 --- a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java @@ -1,70 +1,71 @@ -/* - * 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.Final; -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 net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.hud.DebugHud; -import net.minecraft.client.gui.hud.InGameHud; -import net.minecraft.util.Identifier; -import net.wurstclient.WurstClient; -import net.wurstclient.event.EventManager; -import net.wurstclient.events.GUIRenderListener.GUIRenderEvent; - -@Mixin(InGameHud.class) -public class IngameHudMixin -{ - @Shadow - @Final - private DebugHud debugHud; - - @Inject( - at = @At(value = "INVOKE", - target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", - remap = false, - ordinal = 3), - method = "render(Lnet/minecraft/client/gui/DrawContext;F)V") - private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) - { - if(debugHud.shouldShowDebugHud()) - return; - - EventManager.fire(new GUIRenderEvent(context, tickDelta)); - } - - @Inject(at = @At("HEAD"), - method = "renderOverlay(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/util/Identifier;F)V", - cancellable = true) - private void onRenderOverlay(DrawContext context, Identifier texture, - float opacity, CallbackInfo ci) - { - if(texture == null - || !"textures/misc/pumpkinblur.png".equals(texture.getPath())) - return; - - if(WurstClient.INSTANCE.getHax().noPumpkinHack.isEnabled()) - ci.cancel(); - } - - @Inject(at = @At("HEAD"), - method = "renderPortalOverlay(Lnet/minecraft/client/util/math/MatrixStack;F)V", - cancellable = true) - private void onRenderPortalOverlay(MatrixStack matrixStack, float nauseaStrength, CallbackInfo ci) - { - if(!WurstClient.INSTANCE.getHax().noPortalOverlayHack.isEnabled()) - return; - - ci.cancel(); - } -} +/* + * 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.Final; +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 net.minecraft.client.gui.DrawContext; +import net.minecraft.client.gui.hud.DebugHud; +import net.minecraft.client.gui.hud.InGameHud; +import net.minecraft.util.Identifier; +import net.wurstclient.WurstClient; +import net.wurstclient.event.EventManager; +import net.wurstclient.events.GUIRenderListener.GUIRenderEvent; + +@Mixin(InGameHud.class) +public class IngameHudMixin +{ + @Shadow + @Final + private DebugHud debugHud; + + @Inject( + at = @At(value = "INVOKE", + target = "Lcom/mojang/blaze3d/systems/RenderSystem;enableBlend()V", + remap = false, + ordinal = 3), + method = "render(Lnet/minecraft/client/gui/DrawContext;F)V") + private void onRender(DrawContext context, float tickDelta, CallbackInfo ci) + { + if(debugHud.shouldShowDebugHud()) + return; + + EventManager.fire(new GUIRenderEvent(context, tickDelta)); + } + + @Inject(at = @At("HEAD"), + method = "renderOverlay(Lnet/minecraft/client/gui/DrawContext;Lnet/minecraft/util/Identifier;F)V", + cancellable = true) + private void onRenderOverlay(DrawContext context, Identifier texture, + float opacity, CallbackInfo ci) + { + if(texture == null + || !"textures/misc/pumpkinblur.png".equals(texture.getPath())) + return; + + if(WurstClient.INSTANCE.getHax().noPumpkinHack.isEnabled()) + ci.cancel(); + } + + @Inject(at = @At("HEAD"), + method = "renderPortalOverlay(Lnet/minecraft/client/gui/DrawContext;F)V", + cancellable = true) + private void onRenderPortalOverlay(DrawContext context, + float nauseaStrength, CallbackInfo ci) + { + if(!WurstClient.INSTANCE.getHax().noPortalOverlayHack.isEnabled()) + return; + + ci.cancel(); + } +} From af92a187526e5d09e11835e39823eaa3c09605a8 Mon Sep 17 00:00:00 2001 From: ThisTestUser Date: Tue, 2 Jan 2024 13:38:25 -0500 Subject: [PATCH 3/3] Year update --- src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java b/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java index 1c4d502d63..bc6104f821 100644 --- a/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java +++ b/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2023 Wurst-Imperium and contributors. + * 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