GoalXZ beacon render setting

This commit is contained in:
Brady 2018-12-03 16:42:05 -06:00
parent e25bf9f077
commit b0066a93ca
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 32 additions and 0 deletions

View File

@ -353,6 +353,12 @@ public class Settings {
*/ */
public Setting<Boolean> renderGoalIgnoreDepth = new Setting<>(true); public Setting<Boolean> 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<Boolean> renderGoalXZBeacon = new Setting<>(false);
/** /**
* Ignore depth when rendering the selection boxes (to break, to place, to walk into) * Ignore depth when rendering the selection boxes (to break, to place, to walk into)
*/ */

View File

@ -33,6 +33,7 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntityBeaconRenderer;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats; import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -297,6 +298,31 @@ public final class PathRenderer implements Helper {
} else if (goal instanceof GoalXZ) { } else if (goal instanceof GoalXZ) {
GoalXZ goalPos = (GoalXZ) goal; 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; minX = goalPos.getX() + 0.002 - renderPosX;
maxX = goalPos.getX() + 1 - 0.002 - renderPosX; maxX = goalPos.getX() + 1 - 0.002 - renderPosX;
minZ = goalPos.getZ() + 0.002 - renderPosZ; minZ = goalPos.getZ() + 0.002 - renderPosZ;