From 3430d5c1dc408e620b477ee849dbd150e917db0a Mon Sep 17 00:00:00 2001 From: L4J <80828850+Logging4J@users.noreply.github.com> Date: Wed, 1 Jan 2025 15:38:13 -0500 Subject: [PATCH] LiquidOverlay Setting in NoRender --- src/main/java/net/aoba/mixin/CameraMixin.java | 7 ++++++- .../net/aoba/mixin/InGameOverlayRendererMixin.java | 11 +++++++++++ .../java/net/aoba/module/modules/render/NoRender.java | 9 +++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/aoba/mixin/CameraMixin.java b/src/main/java/net/aoba/mixin/CameraMixin.java index 2b07951d..93a4a354 100644 --- a/src/main/java/net/aoba/mixin/CameraMixin.java +++ b/src/main/java/net/aoba/mixin/CameraMixin.java @@ -1,5 +1,7 @@ package net.aoba.mixin; +import net.aoba.module.modules.movement.Freecam; +import net.aoba.module.modules.render.NoRender; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; @@ -43,7 +45,10 @@ private void onCameraUdate(BlockView area, Entity focusedEntity, boolean thirdPe @Inject(at = { @At("HEAD") }, method = "getSubmersionType()Lnet/minecraft/block/enums/CameraSubmersionType;", cancellable = true) private void onGetSubmersionType(CallbackInfoReturnable cir) { - if (Aoba.getInstance().moduleManager.freecam.state.getValue()) { + Freecam freecam = Aoba.getInstance().moduleManager.freecam; + NoRender norender = Aoba.getInstance().moduleManager.norender; + + if (freecam.state.getValue() || (norender.state.getValue() && norender.getNoLiquidOverlay())) { cir.setReturnValue(CameraSubmersionType.NONE); } } diff --git a/src/main/java/net/aoba/mixin/InGameOverlayRendererMixin.java b/src/main/java/net/aoba/mixin/InGameOverlayRendererMixin.java index 110a3aa6..82e8b351 100644 --- a/src/main/java/net/aoba/mixin/InGameOverlayRendererMixin.java +++ b/src/main/java/net/aoba/mixin/InGameOverlayRendererMixin.java @@ -1,5 +1,6 @@ package net.aoba.mixin; +import net.minecraft.client.MinecraftClient; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -13,6 +14,7 @@ @Mixin(InGameOverlayRenderer.class) public abstract class InGameOverlayRendererMixin { + @Inject(method = "renderFireOverlay(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;)V", at = @At("HEAD"), cancellable = true) private static void onRenderFireOverlay(MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo info) { @@ -21,4 +23,13 @@ private static void onRenderFireOverlay(MatrixStack matrices, VertexConsumerProv if (norender.state.getValue() && norender.getNoFireOverlay()) info.cancel(); } + + @Inject(method = "renderUnderwaterOverlay", at = @At("HEAD"), cancellable = true) + private static void onRenderUnderwaterOverlay(MinecraftClient client, MatrixStack matrices, + VertexConsumerProvider vertexConsumers, CallbackInfo info) { + NoRender norender = Aoba.getInstance().moduleManager.norender; + + if (norender.state.getValue() && norender.getNoLiquidOverlay()) + info.cancel(); + } } diff --git a/src/main/java/net/aoba/module/modules/render/NoRender.java b/src/main/java/net/aoba/module/modules/render/NoRender.java index 782dee72..1966846e 100644 --- a/src/main/java/net/aoba/module/modules/render/NoRender.java +++ b/src/main/java/net/aoba/module/modules/render/NoRender.java @@ -32,6 +32,10 @@ public class NoRender extends Module { .displayName("Powder Snow Overlay").description("Does not render the overlay when in powder snow.") .defaultValue(false).build(); + private BooleanSetting noLiquidOverlay = BooleanSetting.builder().id("norender_liquid") + .displayName("Liquid Overlay").description("Does not render the overlay when in liquids.") + .defaultValue(false).build(); + private BooleanSetting noCrosshair = BooleanSetting.builder().id("norender_crosshair").displayName("Crosshair") .description("Does not render the crosshair.").defaultValue(false).build(); @@ -47,6 +51,7 @@ public NoRender() { this.addSetting(noFireOverlay); this.addSetting(noPortalOverlay); this.addSetting(noPowderSnowOverlay); + this.addSetting(noLiquidOverlay); this.addSetting(noCrosshair); } @@ -93,6 +98,10 @@ public boolean getNoPowderSnowOverlay() { return this.noPowderSnowOverlay.getValue(); } + public boolean getNoLiquidOverlay() { + return this.noLiquidOverlay.getValue(); + } + public boolean getNoCrosshair() { return this.noCrosshair.getValue(); }