feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
using MinecraftClient.Mapping;
|
2026-04-11 02:27:10 +08:00
|
|
|
using MinecraftClient.Pathing.Core;
|
|
|
|
|
|
|
|
|
|
namespace MinecraftClient.Pathing.Moves.Impl
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
/// Straight-down fall at the current X,Z position.
|
|
|
|
|
/// Supports water landing and mid-fall ladder/vine grabbing.
|
|
|
|
|
/// Used for drops where MoveDescend's 1-block horizontal offset doesn't apply.
|
2026-04-11 02:27:10 +08:00
|
|
|
/// </summary>
|
|
|
|
|
public sealed class MoveFall : IMove
|
|
|
|
|
{
|
|
|
|
|
public MoveType Type => MoveType.Fall;
|
|
|
|
|
public int XOffset => 0;
|
|
|
|
|
public int ZOffset => 0;
|
|
|
|
|
public bool DynamicY => true;
|
|
|
|
|
|
|
|
|
|
private readonly int _maxScanDepth;
|
|
|
|
|
|
|
|
|
|
public MoveFall(int maxScanDepth = 256)
|
|
|
|
|
{
|
|
|
|
|
_maxScanDepth = maxScanDepth;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Calculate(CalculationContext ctx, int x, int y, int z, ref MoveResult result)
|
|
|
|
|
{
|
|
|
|
|
if (!ctx.CanWalkThrough(x, y - 1, z))
|
|
|
|
|
{
|
|
|
|
|
result.SetImpossible();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
double costSoFar = 0;
|
|
|
|
|
int effectiveStartHeight = y;
|
|
|
|
|
|
2026-04-11 02:27:10 +08:00
|
|
|
for (int fallDist = 1; fallDist <= _maxScanDepth; fallDist++)
|
|
|
|
|
{
|
|
|
|
|
int landY = y - fallDist;
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
if (landY < -64) break;
|
2026-04-11 02:27:10 +08:00
|
|
|
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
Material ontoMat = ctx.GetMaterial(x, landY, z);
|
|
|
|
|
int unprotectedFallHeight = fallDist - (y - effectiveStartHeight);
|
2026-04-11 02:27:10 +08:00
|
|
|
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
// Water landing: safe regardless of height
|
|
|
|
|
if (MoveHelper.IsWater(ontoMat))
|
|
|
|
|
{
|
|
|
|
|
double waterCost = ActionCosts.FallCost(unprotectedFallHeight) + costSoFar;
|
|
|
|
|
result.Set(x, landY, z, waterCost);
|
|
|
|
|
return;
|
|
|
|
|
}
|
2026-04-11 02:27:10 +08:00
|
|
|
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
// Mid-fall ladder/vine grab (resets effective fall height)
|
|
|
|
|
if (ctx.AllowLadderGrabDuringFall && unprotectedFallHeight <= 11
|
|
|
|
|
&& ontoMat.CanBeClimbedOn())
|
|
|
|
|
{
|
|
|
|
|
costSoFar += ActionCosts.FallCost(unprotectedFallHeight - 1);
|
|
|
|
|
costSoFar += ActionCosts.LadderDownOne;
|
|
|
|
|
effectiveStartHeight = landY;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2026-04-11 02:27:10 +08:00
|
|
|
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
if (ctx.CanWalkThrough(x, landY, z))
|
|
|
|
|
continue;
|
2026-04-11 02:27:10 +08:00
|
|
|
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
// Hit something solid
|
|
|
|
|
if (!ctx.CanWalkOn(x, landY, z))
|
|
|
|
|
{
|
|
|
|
|
result.SetImpossible();
|
2026-04-11 02:27:10 +08:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
if (MoveHelper.IsHazardous(ontoMat))
|
2026-04-11 02:27:10 +08:00
|
|
|
{
|
|
|
|
|
result.SetImpossible();
|
|
|
|
|
return;
|
|
|
|
|
}
|
feat: add 4-block jumps, diagonal parkour, high-fall water/ladder support
MoveParkour rewritten to support both cardinal and diagonal sprint jumps
with unified (xOff, zOff) interface. New capabilities:
- 4-block cardinal sprint jumps with edge-approach timing in template
- Diagonal parkour: (2,1), (1,2), (2,2), (3,1), (1,3) in all quadrants
- Ascending parkour extended to dist=3 (cardinal)
- Overshoot safety check after landing destination
- Block parkour from climbable starting blocks (vine/ladder)
MoveDescend/MoveFall enhanced with Baritone-style dynamic fall scanning:
- Water landing: accepts falls of any height into water
- Mid-fall ladder/vine grab: resets effective fall height (<=11 blocks)
- CalculationContext gains MaxFallHeightWater, AllowLadderGrabDuringFall
SprintJumpTemplate gains distance-based approach timing:
- Long jumps (>=3.5 blocks): delays jump until 0.5 blocks from center
- Medium jumps (>=2.5): 0.35 blocks approach
- Landing tolerance scales with jump distance
All movements verified on 1.21.11 local server.
Made-with: Cursor
2026-04-11 14:45:54 +08:00
|
|
|
|
|
|
|
|
// Solid landing within safe height
|
|
|
|
|
if (unprotectedFallHeight <= ctx.MaxFallHeight + 1)
|
|
|
|
|
{
|
|
|
|
|
double cost = ActionCosts.FallCost(unprotectedFallHeight) + costSoFar;
|
|
|
|
|
result.Set(x, landY + 1, z, cost);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Too high for safe landing
|
|
|
|
|
result.SetImpossible();
|
|
|
|
|
return;
|
2026-04-11 02:27:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.SetImpossible();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|