Merge pull request #412 from EvilSourcerer/master

render dank lit boxes for goalYLevel
This commit is contained in:
Leijurv 2019-05-02 23:02:02 -07:00
commit a6d4708ccf
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
4 changed files with 16 additions and 4 deletions

2
.gitignore vendored
View File

@ -18,4 +18,4 @@ classes/
# Copyright Files
!/.idea/copyright/Baritone.xml
!/.idea/copyright/profiles_settings.xml
!/.idea/copyright/profiles_settings.xml

View File

@ -30,8 +30,8 @@ import java.awt.*;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.*;
import java.util.List;
import java.util.*;
import java.util.function.Consumer;
/**
@ -81,6 +81,8 @@ public final class Settings {
*/
public final Setting<Double> jumpPenalty = new Setting<>(2D);
public final Setting<Double> yLevelBoxSize = new Setting<>(15D);
/**
* Walking on water uses up hunger really quick, so penalize it
*/

View File

@ -29,7 +29,7 @@ public class GoalYLevel implements Goal, ActionCosts {
/**
* The target Y level
*/
private final int level;
public final int level;
public GoalYLevel(int level) {
this.level = level;

View File

@ -276,13 +276,13 @@ public final class PathRenderer implements Helper {
double maxY;
double y1;
double y2;
double y = MathHelper.cos((float) (((float) ((System.nanoTime() / 100000L) % 20000L)) / 20000F * Math.PI * 2));
if (goal instanceof IGoalRenderPos) {
BlockPos goalPos = ((IGoalRenderPos) goal).getGoalPos();
minX = goalPos.getX() + 0.002 - renderPosX;
maxX = goalPos.getX() + 1 - 0.002 - renderPosX;
minZ = goalPos.getZ() + 0.002 - renderPosZ;
maxZ = goalPos.getZ() + 1 - 0.002 - renderPosZ;
double y = MathHelper.cos((float) (((float) ((System.nanoTime() / 100000L) % 20000L)) / 20000F * Math.PI * 2));
if (goal instanceof GoalGetToBlock || goal instanceof GoalTwoBlocks) {
y /= 2;
}
@ -341,6 +341,16 @@ public final class PathRenderer implements Helper {
drawDankLitGoalBox(player, g, partialTicks, color);
}
return;
} else if (goal instanceof GoalYLevel) {
GoalYLevel goalpos = (GoalYLevel) goal;
minX = player.posX - Baritone.settings().yLevelBoxSize.value - renderPosX;
minZ = player.posZ - Baritone.settings().yLevelBoxSize.value - renderPosZ;
maxX = player.posX + Baritone.settings().yLevelBoxSize.value - renderPosX;
maxZ = player.posZ + Baritone.settings().yLevelBoxSize.value - renderPosZ;
minY = ((GoalYLevel) goal).level - renderPosY;
maxY = minY + 2;
y1 = 1 + y + goalpos.level - renderPosY;
y2 = 1 - y + goalpos.level - renderPosY;
} else {
return;
}