[PR #2224] [MERGED] Count fall, riding and flying statistics as vanilla does #4117

Closed
opened 2026-11-03 04:14:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2224
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/stats-movement


📝 Commits (2)

  • a4d0f76 Count movement statistics as vanilla does
  • 6964ee8 Merge main into fix/stats-movement

📊 Changes

3 files changed (+33 additions, -10 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+7 -0)
📝 crates/horizon-client/src/game/stats.rs (+22 -10)

📄 Description

What and why

The movement statistics did not match vanilla:

  • fall_one_cm went up on every downward tick, so normal jumps counted. Vanilla adds it once per landing, only for a fall of 2 blocks or more, as the rounded fall distance in cm (and not for players that may fly).
  • Riding any other mob counted as minecart or boat distance, and horses counted only the sideways distance. Vanilla counts a pig, a horse-family mount (full 3D distance), a strider, a happy ghast, a nautilus, a boat or a minecart, and nothing for other mounts. happy_ghast_one_cm and nautilus_one_cm were never counted.
  • fly_one_cm was counted only while flying. Vanilla counts any airborne, non-gliding move of more than 25 cm sideways.

The fall statistic comes from the landing event the motion code already produces (FallEvent::Statistic), which nothing used. It is now counted for the host's own player and for players on the server thread.

Vanilla reference

  • Player.causeFallDamage (FALL_ONE_CM for fallDistance >= 2.0, skipped when mayFly)
  • ServerPlayer.checkRidingStatistics
  • ServerPlayer.checkMovementStatistics (last branch, FLY_ONE_CM when more than 25 cm)

Self-check

cargo check -p horizon-client passes.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/2224 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/stats-movement` --- ### 📝 Commits (2) - [`a4d0f76`](https://github.com/horizon-rust/horizon/commit/a4d0f76edd735cc6bcb5a9452679759564ebb3b8) Count movement statistics as vanilla does - [`6964ee8`](https://github.com/horizon-rust/horizon/commit/6964ee8ece96858784b7e022513c64f57384767e) Merge main into fix/stats-movement ### 📊 Changes **3 files changed** (+33 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+7 -0) 📝 `crates/horizon-client/src/game/stats.rs` (+22 -10) </details> ### 📄 Description ## What and why The movement statistics did not match vanilla: - `fall_one_cm` went up on every downward tick, so normal jumps counted. Vanilla adds it once per landing, only for a fall of 2 blocks or more, as the rounded fall distance in cm (and not for players that may fly). - Riding any other mob counted as minecart or boat distance, and horses counted only the sideways distance. Vanilla counts a pig, a horse-family mount (full 3D distance), a strider, a happy ghast, a nautilus, a boat or a minecart, and nothing for other mounts. `happy_ghast_one_cm` and `nautilus_one_cm` were never counted. - `fly_one_cm` was counted only while flying. Vanilla counts any airborne, non-gliding move of more than 25 cm sideways. The fall statistic comes from the landing event the motion code already produces (`FallEvent::Statistic`), which nothing used. It is now counted for the host's own player and for players on the server thread. ## Vanilla reference - `Player.causeFallDamage` (`FALL_ONE_CM` for `fallDistance >= 2.0`, skipped when `mayFly`) - `ServerPlayer.checkRidingStatistics` - `ServerPlayer.checkMovementStatistics` (last branch, `FLY_ONE_CM` when more than 25 cm) ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:48 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#4117
No description provided.