mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
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
30 lines
796 B
C#
30 lines
796 B
C#
using System.Collections.Generic;
|
|
|
|
namespace MinecraftClient.Pathing.Core
|
|
{
|
|
public enum PathStatus
|
|
{
|
|
Success,
|
|
Partial,
|
|
Failed
|
|
}
|
|
|
|
public sealed class PathResult
|
|
{
|
|
public PathStatus Status { get; }
|
|
public IReadOnlyList<PathNode> Path { get; }
|
|
public int NodesExplored { get; }
|
|
public long ElapsedMs { get; }
|
|
|
|
public PathResult(PathStatus status, IReadOnlyList<PathNode> path, int nodesExplored, long elapsedMs)
|
|
{
|
|
Status = status;
|
|
Path = path;
|
|
NodesExplored = nodesExplored;
|
|
ElapsedMs = elapsedMs;
|
|
}
|
|
|
|
public static PathResult Fail(int nodesExplored, long elapsedMs)
|
|
=> new(PathStatus.Failed, [], nodesExplored, elapsedMs);
|
|
}
|
|
}
|