diff --git a/src/main/java/baritone/pathfinding/goals/Goal.java b/src/main/java/baritone/bot/pathfinding/goals/Goal.java similarity index 95% rename from src/main/java/baritone/pathfinding/goals/Goal.java rename to src/main/java/baritone/bot/pathfinding/goals/Goal.java index 244b61da..327f01fa 100644 --- a/src/main/java/baritone/pathfinding/goals/Goal.java +++ b/src/main/java/baritone/bot/pathfinding/goals/Goal.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package baritone.pathfinding.goals; +package baritone.bot.goals; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/baritone/pathfinding/goals/GoalBlock.java b/src/main/java/baritone/bot/pathfinding/goals/GoalBlock.java similarity index 90% rename from src/main/java/baritone/pathfinding/goals/GoalBlock.java rename to src/main/java/baritone/bot/pathfinding/goals/GoalBlock.java index 1e9bf627..b23011cb 100644 --- a/src/main/java/baritone/pathfinding/goals/GoalBlock.java +++ b/src/main/java/baritone/bot/pathfinding/goals/GoalBlock.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package baritone.pathfinding.goals; +package baritone.bot.goals; import baritone.Baritone; import baritone.pathfinding.actions.Action; @@ -39,6 +39,10 @@ public class GoalBlock implements Goal { public boolean isInGoal(BlockPos pos) { return pos.getX() == this.x && pos.getY() == this.y && pos.getZ() == this.z; } + + /** + * The range over which to begin considering Y coordinate in the heuristic + */ static final double MIN = 20; static final double MAX = 150; @@ -55,6 +59,7 @@ public class GoalBlock implements Goal { double heuristic = 0; double baseline = (Action.PLACE_ONE_BLOCK_COST + Action.FALL_ONE_BLOCK_COST) * 32; if (pythaDist < MAX) {//if we are more than MAX away, ignore the Y coordinate. It really doesn't matter how far away your Y coordinate is if you X coordinate is 1000 blocks away. + //as we get closer, slowly reintroduce the Y coordinate as a heuristic cost double multiplier = pythaDist < MIN ? 1 : 1 - (pythaDist - MIN) / (MAX - MIN); if (yDiff < 0) {//pos.getY()-this.y<0 therefore pos.getY()