Skip to content

Commit

Permalink
Merge pull request #78 from Logging4J/master
Browse files Browse the repository at this point in the history
LiquidOverlay Setting in NoRender
  • Loading branch information
coltonk9043 authored Jan 4, 2025
2 parents e31b858 + 3430d5c commit a47f190
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/net/aoba/mixin/CameraMixin.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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<CameraSubmersionType> 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);
}
}
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/net/aoba/mixin/InGameOverlayRendererMixin.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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) {
Expand All @@ -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();
}
}
9 changes: 9 additions & 0 deletions src/main/java/net/aoba/module/modules/render/NoRender.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -47,6 +51,7 @@ public NoRender() {
this.addSetting(noFireOverlay);
this.addSetting(noPortalOverlay);
this.addSetting(noPowderSnowOverlay);
this.addSetting(noLiquidOverlay);
this.addSetting(noCrosshair);
}

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit a47f190

Please sign in to comment.