fix goal y level render, fixes #48

This commit is contained in:
leijurv 2018-08-17 19:30:41 -07:00
parent 88b276f7c9
commit 1dcad9ac59
2 changed files with 8 additions and 8 deletions

View File

@ -44,7 +44,7 @@ public class GoalYLevel implements Goal {
public double heuristic(BlockPos pos) { public double heuristic(BlockPos pos) {
if (pos.getY() > level) { if (pos.getY() > level) {
// need to descend // need to descend
return FALL_N_BLOCKS_COST[pos.getY() - level]; return FALL_N_BLOCKS_COST[1] * (pos.getY() - level);
} }
if (pos.getY() < level) { if (pos.getY() < level) {
// need to ascend // need to ascend

View File

@ -170,13 +170,6 @@ public final class PathRenderer implements Helper {
} }
public static void drawLitDankGoalBox(EntityPlayer player, Goal goal, float partialTicks, Color color) { public static void drawLitDankGoalBox(EntityPlayer player, Goal goal, float partialTicks, Color color) {
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(color.getColorComponents(null)[0], color.getColorComponents(null)[1], color.getColorComponents(null)[2], 0.6F);
GlStateManager.glLineWidth(Baritone.settings().goalRenderLineWidth.get());
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
float expand = 0.002F;
double renderPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks; double renderPosX = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double) partialTicks;
double renderPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks; double renderPosY = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double) partialTicks;
double renderPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks; double renderPosZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double) partialTicks;
@ -217,6 +210,13 @@ public final class PathRenderer implements Helper {
return; return;
} }
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(color.getColorComponents(null)[0], color.getColorComponents(null)[1], color.getColorComponents(null)[2], 0.6F);
GlStateManager.glLineWidth(Baritone.settings().goalRenderLineWidth.get());
GlStateManager.disableTexture2D();
GlStateManager.depthMask(false);
if (y1 != 0) { if (y1 != 0) {
BUFFER.begin(GL_LINE_STRIP, DefaultVertexFormats.POSITION); BUFFER.begin(GL_LINE_STRIP, DefaultVertexFormats.POSITION);
BUFFER.pos(minX, y1, minZ).endVertex(); BUFFER.pos(minX, y1, minZ).endVertex();