[PR #1892] [MERGED] Chickens flap while they fall on a client of a server #3844

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1892
Author: @vlesmentie
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/chicken-flap-remote


📝 Commits (3)

  • 2c8930c Chickens flap while they fall on a client of a server
  • d5b88ff Merge origin/main into fix/chicken-flap-remote
  • 9d53016 Chickens: the flap test uses the shared test mob type

📊 Changes

2 files changed (+56 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+4 -0)
📝 crates/horizon-client/src/mobs/farm.rs (+52 -9)

📄 Description

🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves.

What and why

Fixes #1706.

A chicken knocked off a cliff kept its wings folded while it fell. chicken_ai_step already follows
Chicken.aiStep (flap, flapSpeed, flapping), but only the server runs it. In vanilla aiStep runs on the
client too, for the chickens it only displays, and the model's wings read those fields. Horizon's
tick_remote_entities (single player on its server thread, and servers) never updated them, so the client's
chickens always drew flapSpeed 0.

  • mobs/farm.rs: the wing part of chicken_ai_step is now chicken_flap; chicken_ai_step calls it, then slows
    the fall and lays eggs as before (the slowdown moved after the wing update it doesn't affect).
  • game/remote.rs: tick_remote_entities runs chicken_flap for chickens after the head interpolation, from the
    on_ground the server sends with each move. The fall slowdown and the eggs stay the server's, as in vanilla
    (ServerLevel check for the eggs; the client's own velocity doesn't move an interpolated entity).

Vanilla reference

  • Chicken.aiStep: oFlap = flap, oFlapSpeed = flapSpeed, flapSpeed += (onGround() ? -1 : 4) * 0.3, clamped to
    0..1; in the air flapping restarts at 1; flapping *= 0.9; flap += flapping * 2; eggs only on a ServerLevel
  • ChickenModel.setupAnim / ChickenRenderer.extractRenderState read flap and flapSpeed (Horizon's Anim::Chicken
    in mobs/anim.rs already does)

Checked against the 26.3 client jar's bytecode (javap).

New test mobs::farm::tests::a_falling_chicken_flaps_and_a_landed_one_folds_its_wings checks chicken_flap's
numbers on the ground, in the air and after landing. The remote tick's other client-side steps (the creeper's
swell, the rabbit's hop) have no test of their own either; it needs a client joined to a server.

Self-check

pr_ready (tools/pr_ready.py on debian, against origin/main at 6f8cad002, 3 min 55 s)

Check Result
Scope ✅ 2 files, +106 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (15 s)
clippy ✅ (48 s)
tests: horizon-client ❌ 1100 passed, 2 failed (2 min 47 s)
doc tests ✅ 0 passed (4 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The two failing tests, packs::cache::tests::zip_content_and_failed_build_invalidate and packs::cache::tests::normalized_and_external_overlay_roots_keep_merged_bytes_current, fail the same way on main at 6f8cad002 on this machine without this change; CI's verify passes them, so it's local.

Not checked in game.

🤖 Generated with Claude Code


🔄 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/1892 **Author:** [@vlesmentie](https://github.com/vlesmentie) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/chicken-flap-remote` --- ### 📝 Commits (3) - [`2c8930c`](https://github.com/horizon-rust/horizon/commit/2c8930c48da0ba6c17db31dcaf09dea9a1465b4f) Chickens flap while they fall on a client of a server - [`d5b88ff`](https://github.com/horizon-rust/horizon/commit/d5b88ff1305396f090da899095e0621b46e17917) Merge origin/main into fix/chicken-flap-remote - [`9d53016`](https://github.com/horizon-rust/horizon/commit/9d5301627bbb81bf46113a9c41dff841d2d4f2e1) Chickens: the flap test uses the shared test mob type ### 📊 Changes **2 files changed** (+56 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+4 -0) 📝 `crates/horizon-client/src/mobs/farm.rs` (+52 -9) </details> ### 📄 Description > 🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves. ## What and why Fixes #1706. A chicken knocked off a cliff kept its wings folded while it fell. `chicken_ai_step` already follows `Chicken.aiStep` (`flap`, `flapSpeed`, `flapping`), but only the server runs it. In vanilla `aiStep` runs on the client too, for the chickens it only displays, and the model's wings read those fields. Horizon's `tick_remote_entities` (single player on its server thread, and servers) never updated them, so the client's chickens always drew `flapSpeed` 0. - `mobs/farm.rs`: the wing part of `chicken_ai_step` is now `chicken_flap`; `chicken_ai_step` calls it, then slows the fall and lays eggs as before (the slowdown moved after the wing update it doesn't affect). - `game/remote.rs`: `tick_remote_entities` runs `chicken_flap` for chickens after the head interpolation, from the `on_ground` the server sends with each move. The fall slowdown and the eggs stay the server's, as in vanilla (`ServerLevel` check for the eggs; the client's own velocity doesn't move an interpolated entity). ## Vanilla reference - `Chicken.aiStep`: `oFlap = flap`, `oFlapSpeed = flapSpeed`, `flapSpeed += (onGround() ? -1 : 4) * 0.3`, clamped to 0..1; in the air `flapping` restarts at 1; `flapping *= 0.9`; `flap += flapping * 2`; eggs only on a `ServerLevel` - `ChickenModel.setupAnim` / `ChickenRenderer.extractRenderState` read `flap` and `flapSpeed` (Horizon's `Anim::Chicken` in `mobs/anim.rs` already does) Checked against the 26.3 client jar's bytecode (`javap`). New test `mobs::farm::tests::a_falling_chicken_flaps_and_a_landed_one_folds_its_wings` checks `chicken_flap`'s numbers on the ground, in the air and after landing. The remote tick's other client-side steps (the creeper's swell, the rabbit's hop) have no test of their own either; it needs a client joined to a server. ## Self-check **pr_ready** (`tools/pr_ready.py` on debian, against origin/main at 6f8cad002, 3 min 55 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +106 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (15 s) | | clippy | ✅ (48 s) | | tests: horizon-client | ❌ 1100 passed, 2 failed (2 min 47 s) | | doc tests | ✅ 0 passed (4 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The two failing tests, `packs::cache::tests::zip_content_and_failed_build_invalidate` and `packs::cache::tests::normalized_and_external_overlay_roots_keep_merged_bytes_current`, fail the same way on `main` at 6f8cad002 on this machine without this change; CI's `verify` passes them, so it's local. Not checked in game. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:43 +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#3844
No description provided.