feat: add Phase 1 core pathfinding architecture
Implements the new Baritone-inspired A* pathfinding system:
- Core types: PathNode, PathResult, MoveResult, MoveType, ActionCosts
- BinaryHeapOpenSet min-heap for A* open set
- AStarPathFinder with timeout, cancellation, partial path support
- CalculationContext for thread-safe world state snapshots
- MoveHelper for block passability checks
- IGoal interface + GoalBlock, GoalXZ, GoalNear, GoalComposite
- IMove interface + MoveTraverse, MoveDiagonal, MoveAscend, MoveDescend, MoveClimb
- /pathfind command for testing the new pathfinder
Made-with: Cursor
2026-04-11 01:48:10 +08:00
|
|
|
namespace MinecraftClient.Pathing.Core
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Result of an IMove.Calculate() call. Mutable struct passed by ref for zero-alloc hot path.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public struct MoveResult
|
|
|
|
|
{
|
|
|
|
|
public int DestX;
|
|
|
|
|
public int DestY;
|
|
|
|
|
public int DestZ;
|
|
|
|
|
public double Cost;
|
2026-04-18 16:04:45 +00:00
|
|
|
public ParkourProfile ParkourProfile;
|
feat: add Phase 1 core pathfinding architecture
Implements the new Baritone-inspired A* pathfinding system:
- Core types: PathNode, PathResult, MoveResult, MoveType, ActionCosts
- BinaryHeapOpenSet min-heap for A* open set
- AStarPathFinder with timeout, cancellation, partial path support
- CalculationContext for thread-safe world state snapshots
- MoveHelper for block passability checks
- IGoal interface + GoalBlock, GoalXZ, GoalNear, GoalComposite
- IMove interface + MoveTraverse, MoveDiagonal, MoveAscend, MoveDescend, MoveClimb
- /pathfind command for testing the new pathfinder
Made-with: Cursor
2026-04-11 01:48:10 +08:00
|
|
|
|
2026-04-18 16:04:45 +00:00
|
|
|
public void Set(int x, int y, int z, double cost, ParkourProfile parkourProfile = ParkourProfile.None)
|
feat: add Phase 1 core pathfinding architecture
Implements the new Baritone-inspired A* pathfinding system:
- Core types: PathNode, PathResult, MoveResult, MoveType, ActionCosts
- BinaryHeapOpenSet min-heap for A* open set
- AStarPathFinder with timeout, cancellation, partial path support
- CalculationContext for thread-safe world state snapshots
- MoveHelper for block passability checks
- IGoal interface + GoalBlock, GoalXZ, GoalNear, GoalComposite
- IMove interface + MoveTraverse, MoveDiagonal, MoveAscend, MoveDescend, MoveClimb
- /pathfind command for testing the new pathfinder
Made-with: Cursor
2026-04-11 01:48:10 +08:00
|
|
|
{
|
|
|
|
|
DestX = x;
|
|
|
|
|
DestY = y;
|
|
|
|
|
DestZ = z;
|
|
|
|
|
Cost = cost;
|
2026-04-18 16:04:45 +00:00
|
|
|
ParkourProfile = parkourProfile;
|
feat: add Phase 1 core pathfinding architecture
Implements the new Baritone-inspired A* pathfinding system:
- Core types: PathNode, PathResult, MoveResult, MoveType, ActionCosts
- BinaryHeapOpenSet min-heap for A* open set
- AStarPathFinder with timeout, cancellation, partial path support
- CalculationContext for thread-safe world state snapshots
- MoveHelper for block passability checks
- IGoal interface + GoalBlock, GoalXZ, GoalNear, GoalComposite
- IMove interface + MoveTraverse, MoveDiagonal, MoveAscend, MoveDescend, MoveClimb
- /pathfind command for testing the new pathfinder
Made-with: Cursor
2026-04-11 01:48:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetImpossible()
|
|
|
|
|
{
|
|
|
|
|
Cost = ActionCosts.CostInf;
|
2026-04-18 16:04:45 +00:00
|
|
|
ParkourProfile = ParkourProfile.None;
|
feat: add Phase 1 core pathfinding architecture
Implements the new Baritone-inspired A* pathfinding system:
- Core types: PathNode, PathResult, MoveResult, MoveType, ActionCosts
- BinaryHeapOpenSet min-heap for A* open set
- AStarPathFinder with timeout, cancellation, partial path support
- CalculationContext for thread-safe world state snapshots
- MoveHelper for block passability checks
- IGoal interface + GoalBlock, GoalXZ, GoalNear, GoalComposite
- IMove interface + MoveTraverse, MoveDiagonal, MoveAscend, MoveDescend, MoveClimb
- /pathfind command for testing the new pathfinder
Made-with: Cursor
2026-04-11 01:48:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public readonly bool IsImpossible => Cost >= ActionCosts.CostInf;
|
|
|
|
|
}
|
|
|
|
|
}
|