2026-04-12 18:46:42 +08:00
|
|
|
using System;
|
feat: add parkour moves and template-based path execution system
Phase 2.2: MoveParkour for sprint-jump across 1-2 block gaps (distance 2-3)
and ascending parkour (distance 2, +1Y). Registered in BuildDefaultMoves
with CalculationContext.AllowParkour gating.
Phase 3.1-3.2: Template execution engine replacing the waypoint queue system.
- IActionTemplate interface with per-tick state machine pattern
- Templates: Walk, Ascend, Descend, Climb, Fall, SprintJump
- ActionTemplateFactory maps MoveType to the correct template
- PathExecutor drives sequential template execution with logging
- PathSegmentManager handles replanning on failure (up to 5 retries)
- McClient integration: MoveToAStar now creates PathSegmentManager,
UpdatePathfindingInput delegates to it, CancelMovement/ClientIsMoving
updated for both old and new systems.
Tested on 1.21.11: straight walk, zigzag maze, stair ascent,
1-gap and 2-gap sprint jumps all pass.
Made-with: Cursor
2026-04-11 12:46:38 +08:00
|
|
|
using MinecraftClient.Mapping;
|
|
|
|
|
using MinecraftClient.Pathing.Core;
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Pathing.Execution
|
|
|
|
|
{
|
|
|
|
|
public sealed class PathSegment
|
|
|
|
|
{
|
|
|
|
|
public required Location Start { get; init; }
|
|
|
|
|
public required Location End { get; init; }
|
|
|
|
|
public required MoveType MoveType { get; init; }
|
2026-04-12 18:46:42 +08:00
|
|
|
public PathTransitionType ExitTransition { get; init; } = PathTransitionType.FinalStop;
|
|
|
|
|
public bool PreserveSprint { get; init; }
|
feat: add parkour moves and template-based path execution system
Phase 2.2: MoveParkour for sprint-jump across 1-2 block gaps (distance 2-3)
and ascending parkour (distance 2, +1Y). Registered in BuildDefaultMoves
with CalculationContext.AllowParkour gating.
Phase 3.1-3.2: Template execution engine replacing the waypoint queue system.
- IActionTemplate interface with per-tick state machine pattern
- Templates: Walk, Ascend, Descend, Climb, Fall, SprintJump
- ActionTemplateFactory maps MoveType to the correct template
- PathExecutor drives sequential template execution with logging
- PathSegmentManager handles replanning on failure (up to 5 retries)
- McClient integration: MoveToAStar now creates PathSegmentManager,
UpdatePathfindingInput delegates to it, CancelMovement/ClientIsMoving
updated for both old and new systems.
Tested on 1.21.11: straight walk, zigzag maze, stair ascent,
1-gap and 2-gap sprint jumps all pass.
Made-with: Cursor
2026-04-11 12:46:38 +08:00
|
|
|
|
2026-04-12 18:46:42 +08:00
|
|
|
public int HeadingX => Math.Sign(End.X - Start.X);
|
|
|
|
|
public int HeadingZ => Math.Sign(End.Z - Start.Z);
|
feat: add parkour moves and template-based path execution system
Phase 2.2: MoveParkour for sprint-jump across 1-2 block gaps (distance 2-3)
and ascending parkour (distance 2, +1Y). Registered in BuildDefaultMoves
with CalculationContext.AllowParkour gating.
Phase 3.1-3.2: Template execution engine replacing the waypoint queue system.
- IActionTemplate interface with per-tick state machine pattern
- Templates: Walk, Ascend, Descend, Climb, Fall, SprintJump
- ActionTemplateFactory maps MoveType to the correct template
- PathExecutor drives sequential template execution with logging
- PathSegmentManager handles replanning on failure (up to 5 retries)
- McClient integration: MoveToAStar now creates PathSegmentManager,
UpdatePathfindingInput delegates to it, CancelMovement/ClientIsMoving
updated for both old and new systems.
Tested on 1.21.11: straight walk, zigzag maze, stair ascent,
1-gap and 2-gap sprint jumps all pass.
Made-with: Cursor
2026-04-11 12:46:38 +08:00
|
|
|
|
|
|
|
|
public override string ToString() =>
|
2026-04-12 18:46:42 +08:00
|
|
|
$"{MoveType}: ({Start.X:F1},{Start.Y:F1},{Start.Z:F1})->({End.X:F1},{End.Y:F1},{End.Z:F1}), transition={ExitTransition}, preserveSprint={PreserveSprint}";
|
feat: add parkour moves and template-based path execution system
Phase 2.2: MoveParkour for sprint-jump across 1-2 block gaps (distance 2-3)
and ascending parkour (distance 2, +1Y). Registered in BuildDefaultMoves
with CalculationContext.AllowParkour gating.
Phase 3.1-3.2: Template execution engine replacing the waypoint queue system.
- IActionTemplate interface with per-tick state machine pattern
- Templates: Walk, Ascend, Descend, Climb, Fall, SprintJump
- ActionTemplateFactory maps MoveType to the correct template
- PathExecutor drives sequential template execution with logging
- PathSegmentManager handles replanning on failure (up to 5 retries)
- McClient integration: MoveToAStar now creates PathSegmentManager,
UpdatePathfindingInput delegates to it, CancelMovement/ClientIsMoving
updated for both old and new systems.
Tested on 1.21.11: straight walk, zigzag maze, stair ascent,
1-gap and 2-gap sprint jumps all pass.
Made-with: Cursor
2026-04-11 12:46:38 +08:00
|
|
|
}
|
|
|
|
|
}
|