diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index fcaea289..f186f51b 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -353,6 +353,12 @@ public class Settings { */ public Setting renderGoalIgnoreDepth = new Setting<>(true); + /** + * Renders X/Z type Goals with the vanilla beacon beam effect. Combining this with + * {@link #renderGoalIgnoreDepth} will cause strange render clipping. + */ + public Setting renderGoalXZBeacon = new Setting<>(false); + /** * Ignore depth when rendering the selection boxes (to break, to place, to walk into) */ diff --git a/src/main/java/baritone/utils/PathRenderer.java b/src/main/java/baritone/utils/PathRenderer.java index e14c14da..f740cdf6 100644 --- a/src/main/java/baritone/utils/PathRenderer.java +++ b/src/main/java/baritone/utils/PathRenderer.java @@ -33,6 +33,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.tileentity.TileEntityBeaconRenderer; import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; @@ -297,6 +298,31 @@ public final class PathRenderer implements Helper { } else if (goal instanceof GoalXZ) { GoalXZ goalPos = (GoalXZ) goal; + if (Baritone.settings().renderGoalXZBeacon.get()) { + mc.getTextureManager().bindTexture(TileEntityBeaconRenderer.TEXTURE_BEACON_BEAM); + + if (Baritone.settings().renderGoalIgnoreDepth.get()) { + GlStateManager.disableDepth(); + } + + TileEntityBeaconRenderer.renderBeamSegment( + goalPos.getX() - renderPosX, + -renderPosY, + goalPos.getZ() - renderPosZ, + partialTicks, + 1.0, + player.world.getTotalWorldTime(), + 0, + 256, + color.getColorComponents(null) + ); + + if (Baritone.settings().renderGoalIgnoreDepth.get()) { + GlStateManager.enableDepth(); + } + return; + } + minX = goalPos.getX() + 0.002 - renderPosX; maxX = goalPos.getX() + 1 - 0.002 - renderPosX; minZ = goalPos.getZ() + 0.002 - renderPosZ;