From 72eec135d02d09b773240c175edb3c8accab8654 Mon Sep 17 00:00:00 2001 From: Leijurv Date: Mon, 10 Sep 2018 09:22:32 -0700 Subject: [PATCH] misc improvements --- src/main/java/baritone/pathing/calc/AStarPathFinder.java | 2 +- src/main/java/baritone/pathing/calc/PathNode.java | 3 ++- .../pathing/movement/movements/MovementParkour.java | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/baritone/pathing/calc/AStarPathFinder.java b/src/main/java/baritone/pathing/calc/AStarPathFinder.java index e1cc7372..d03e52f8 100644 --- a/src/main/java/baritone/pathing/calc/AStarPathFinder.java +++ b/src/main/java/baritone/pathing/calc/AStarPathFinder.java @@ -158,8 +158,8 @@ public class AStarPathFinder extends AbstractNodeCostSearch implements Helper { if (neighbor.isOpen) { openSet.update(neighbor); } else { - openSet.insert(neighbor);//dont double count, dont insert into open set if it's already there neighbor.isOpen = true; + openSet.insert(neighbor);//dont double count, dont insert into open set if it's already there } for (int i = 0; i < bestSoFar.length; i++) { double heuristic = neighbor.estimatedCostToGoal + neighbor.cost / COEFFICIENTS[i]; diff --git a/src/main/java/baritone/pathing/calc/PathNode.java b/src/main/java/baritone/pathing/calc/PathNode.java index 45190fa7..3d984548 100644 --- a/src/main/java/baritone/pathing/calc/PathNode.java +++ b/src/main/java/baritone/pathing/calc/PathNode.java @@ -18,6 +18,7 @@ package baritone.pathing.calc; import baritone.pathing.goals.Goal; +import baritone.pathing.movement.ActionCosts; import baritone.pathing.movement.Movement; import baritone.utils.pathing.BetterBlockPos; @@ -81,7 +82,7 @@ public final class PathNode { public PathNode(BetterBlockPos pos, Goal goal) { this.pos = pos; this.previous = null; - this.cost = Short.MAX_VALUE; + this.cost = ActionCosts.COST_INF; this.goal = goal; this.estimatedCostToGoal = goal.heuristic(pos); this.previousMovement = null; diff --git a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java index 1041ae07..8cd37c73 100644 --- a/src/main/java/baritone/pathing/movement/movements/MovementParkour.java +++ b/src/main/java/baritone/pathing/movement/movements/MovementParkour.java @@ -65,6 +65,12 @@ public class MovementParkour extends Movement { if (!MovementHelper.fullyPassable(src.up().offset(dir))) { return null; } + if (!MovementHelper.fullyPassable(src.up(2).offset(dir))) { + return null; + } + if (!MovementHelper.fullyPassable(src.up(2))) { + return null; + } for (int i = 2; i <= 4; i++) { BlockPos dest = src.offset(dir, i); // TODO perhaps dest.up(3) doesn't need to be fullyPassable, just canWalkThrough, possibly?