mirror of
https://github.com/cabaletta/baritone
synced 2024-12-28 18:02:17 +00:00
misc improvements
This commit is contained in:
parent
075ad3f244
commit
72eec135d0
@ -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];
|
||||
|
@ -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;
|
||||
|
@ -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?
|
||||
|
Loading…
Reference in New Issue
Block a user