mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-29 13:04:59 +00:00
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
This commit is contained in:
parent
3efe63c54d
commit
1abab20f17
23 changed files with 1222 additions and 0 deletions
28
MinecraftClient/Pathing/Core/MoveResult.cs
Normal file
28
MinecraftClient/Pathing/Core/MoveResult.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
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;
|
||||
|
||||
public void Set(int x, int y, int z, double cost)
|
||||
{
|
||||
DestX = x;
|
||||
DestY = y;
|
||||
DestZ = z;
|
||||
Cost = cost;
|
||||
}
|
||||
|
||||
public void SetImpossible()
|
||||
{
|
||||
Cost = ActionCosts.CostInf;
|
||||
}
|
||||
|
||||
public readonly bool IsImpossible => Cost >= ActionCosts.CostInf;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue