pathing: tighten linear parkour execution

This commit is contained in:
BruceChen 2026-04-18 06:14:45 +00:00
parent 891763602a
commit d919bff91f
22 changed files with 2072 additions and 79 deletions

View file

@ -529,16 +529,23 @@ namespace MinecraftClient.Physics
/// </summary>
private float GetFrictionInfluencedSpeed(float friction)
{
float effectiveSpeed = GetEffectiveMovementSpeed();
if (OnGround)
{
return MovementSpeed * (PhysicsConsts.GroundAccelerationFactor / (friction * friction * friction));
return effectiveSpeed * (PhysicsConsts.GroundAccelerationFactor / (friction * friction * friction));
}
else
{
return CreativeFlying ? MovementSpeed * 0.1f : PhysicsConsts.AirAcceleration;
return CreativeFlying ? effectiveSpeed * 0.1f : effectiveSpeed * 0.2f;
}
}
private float GetEffectiveMovementSpeed()
{
// Vanilla applies a transient +30% total movement-speed modifier while sprinting.
return Sprinting ? MovementSpeed * 1.3f : MovementSpeed;
}
/// <summary>
/// Get the friction of the block below the player's feet.
/// </summary>