diff --git a/src/main/java/net/wurstclient/hack/HackList.java b/src/main/java/net/wurstclient/hack/HackList.java index 9452762410..aeadb8ada6 100644 --- a/src/main/java/net/wurstclient/hack/HackList.java +++ b/src/main/java/net/wurstclient/hack/HackList.java @@ -138,6 +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 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 new file mode 100644 index 0000000000..bc6104f821 --- /dev/null +++ b/src/main/java/net/wurstclient/hacks/NoPortalOverlayHack.java @@ -0,0 +1,24 @@ +/* + * 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.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 395b783029..ef5a65908e 100644 --- a/src/main/java/net/wurstclient/mixin/IngameHudMixin.java +++ b/src/main/java/net/wurstclient/mixin/IngameHudMixin.java @@ -55,4 +55,16 @@ private void onRenderOverlay(DrawContext context, Identifier texture, 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(); + } } diff --git a/src/main/resources/assets/wurst/lang/en_us.json b/src/main/resources/assets/wurst/lang/en_us.json index 62e869714a..99196e818f 100644 --- a/src/main/resources/assets/wurst/lang/en_us.json +++ b/src/main/resources/assets/wurst/lang/en_us.json @@ -119,6 +119,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.noshieldoverlay": "Lowers the shield so it covers less of your screen.", "description.wurst.hack.noslowdown": "Cancels slowness effects caused by honey, soul sand and using items.",