From d3bf4ef1983eaee5c82bf4d44a62f4379f469cf2 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Tue, 9 Oct 2018 19:34:53 -0700 Subject: [PATCH] renderSelectionBoxesIgnoreDepth --- src/api/java/baritone/api/Settings.java | 5 +++++ src/main/java/baritone/utils/PathRenderer.java | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index a755786f5..a0360909f 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -307,6 +307,11 @@ public class Settings { */ public Setting renderGoalIgnoreDepth = new Setting<>(false); + /** + * Ignore depth when rendering the selection boxes (to break, to place, to walk into) + */ + public Setting renderSelectionBoxesIgnoreDepth = new Setting<>(false); + /** * Line width of the path when rendered, in pixels */ diff --git a/src/main/java/baritone/utils/PathRenderer.java b/src/main/java/baritone/utils/PathRenderer.java index 841876d82..cde3f1b47 100644 --- a/src/main/java/baritone/utils/PathRenderer.java +++ b/src/main/java/baritone/utils/PathRenderer.java @@ -19,11 +19,11 @@ package baritone.utils; import baritone.Baritone; import baritone.api.event.events.RenderEvent; +import baritone.api.pathing.calc.IPath; import baritone.api.pathing.goals.Goal; import baritone.api.pathing.goals.GoalComposite; import baritone.api.pathing.goals.GoalTwoBlocks; import baritone.api.pathing.goals.GoalXZ; -import baritone.api.pathing.calc.IPath; import baritone.api.utils.BetterBlockPos; import baritone.api.utils.interfaces.IGoalRenderPos; import baritone.behavior.PathingBehavior; @@ -187,6 +187,11 @@ public final class PathRenderer implements Helper { GlStateManager.glLineWidth(Baritone.settings().pathRenderLineWidthPixels.get()); GlStateManager.disableTexture2D(); GlStateManager.depthMask(false); + + if (Baritone.settings().renderSelectionBoxesIgnoreDepth.get()) { + GlStateManager.disableDepth(); + } + float expand = 0.002F; //BlockPos blockpos = movingObjectPositionIn.getBlockPos(); @@ -228,6 +233,10 @@ public final class PathRenderer implements Helper { TESSELLATOR.draw(); }); + if (Baritone.settings().renderSelectionBoxesIgnoreDepth.get()) { + GlStateManager.enableDepth(); + } + GlStateManager.depthMask(true); GlStateManager.enableTexture2D(); GlStateManager.disableBlend();