[PR #1421] [MERGED] Server's mobs: babies, wool, collars, fire, slime sizes and health reach its clients #3511

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1421
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @ludovic111

Base: main ← Head: fix/st-entity-data


📝 Commits (1)

  • c35ea95 Server's mobs: babies, wool, collars, fire, slime sizes and health reach its clients

📊 Changes

12 files changed (+331 additions, -17 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+44 -3)
📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+4 -0)
📝 crates/horizon-client/src/game/dragon.rs (+1 -0)
📝 crates/horizon-client/src/game/lan.rs (+24 -7)
📝 crates/horizon-client/src/game/lan_entities.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+4 -4)
➕ crates/horizon-client/src/game/remote_mob_data.rs (+136 -0)
📝 crates/horizon-client/src/lan/entity.rs (+33 -1)
📝 crates/horizon-client/src/lan/hub.rs (+1 -0)
📝 crates/horizon-client/tests/lan_bot.rs (+1 -0)
📝 tools/lan_e2e.py (+81 -2)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

A client of a server (single player on its server thread, a LAN guest, a dedicated server's player) only applied a rabbit's baby flag and a creeper's swell from SetEntityData. It now reads what vanilla's onSyncedDataUpdated reads:

  • Entity's on-fire flag
  • LivingEntity's health (the wither's boss bar follows it)
  • the baby flag of every ageable mob
  • Sheep.DATA_WOOL_ID
  • TamableAnimal's sitting and tame flags
  • the wolf's and cat's collar colour, which starts at vanilla's red
  • the size of the cube mobs (slime, magma cube)

On the server side:

  • The server sends the collar colour.
  • Pairing still carries only non-default values. A mob's state now also lists the defaults of the entries that can go back to them (health, baby, wool, collar). When one does, the tracker sends that default, so a calf growing up and a sheep's wool growing back reach the clients. A unit test covers this.
  • Sheep saves wrote the colour and shearing state they were loaded with, and loads ignored both. Saves and loads now follow Sheep.add/readAdditionalSaveData.

Stacked: first of 7 chained PRs (bugs-st-1). Merge order: #1421 → #1422 → #1423 → #1424 → #1425 → #1426 → #1427. Each one adds a check to tools/lan_e2e.py, so they are chained to avoid conflicts.

Fixes #1367
Fixes #1368
Fixes #1369
Fixes #1370
Fixes #1371
Fixes #1385
Fixes #1390

Why

Since #1265, single player's window is a remote client of its own server thread, as a LAN guest's is. Whatever the server doesn't send, single player no longer shows. This PR is part of the bugs-st-1 batch: visuals and entity data on the server thread.

How tested

New lan_e2e check looks, run in both modes. It summons a burning cow, a calf, a red sheared sheep, a size-4 slime, a tamed sitting wolf with a blue collar and a wither, then changes them (wither hurt, sheep dyed and its wool back, calf grown, fire out). The host and the guest must see every state.

  • main, server thread: FAIL. The host sees cow@-5 burning False, wants True, cow@-3 baby False, sheep@1 color 0, sheared False, slime@3 size 1, …
  • this branch: PASS, server thread and old mode. The latest runs after the final fixup passed 1/1 on the server thread and 3/3 in old mode.
  • server_entities parity harness: PASS (pairing data is unchanged against vanilla).

Every check was run through tools/lan_e2e.py (--server-thread and old mode) on the Mac mini, from the top of the chain (fix/st-particles), which contains this PR.

Self-check, run once on the top of the chain:

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at e325fa658, 4 min 27 s)

Check Result
Scope ⚠️ 37 files, +2165 −148; 2310 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 293 run, FAILED (errors=2) (20 s)
rustfmt ✅ (4 s)
clippy ✅ (13 s)
tests: horizon-client, horizon-protocol ✅ 1238 passed (3 min 39 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 103 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 91 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Notes on the block:

  • Python tests: the 2 errors also happen on origin/main on this Mac, so they are not from this chain.
    • test_parity_runner: java exits 127 in the test's sandbox.
    • test_rust_parity: /private/var vs /var in relative_to.
  • Parity: the 103 affected harnesses ran in full at the top of the chain before a final rework of the entity defaults. 102 passed and server_entities failed. After the rework, server_entities was rerun and passes. Since then the chain has changed only one lan_e2e cleanup line (Python).

Needs Ludovic

Nothing beyond review. Merge in the chain order above. Each later PR's diff shrinks to its own commit once the earlier PRs are merged.

🤖 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/1421 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/st-entity-data` --- ### 📝 Commits (1) - [`c35ea95`](https://github.com/horizon-rust/horizon/commit/c35ea9568f4771e360cf353df64034237612daef) Server's mobs: babies, wool, collars, fire, slime sizes and health reach its clients ### 📊 Changes **12 files changed** (+331 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+44 -3) 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -0) 📝 `crates/horizon-client/src/game/dragon.rs` (+1 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+24 -7) 📝 `crates/horizon-client/src/game/lan_entities.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+4 -4) ➕ `crates/horizon-client/src/game/remote_mob_data.rs` (+136 -0) 📝 `crates/horizon-client/src/lan/entity.rs` (+33 -1) 📝 `crates/horizon-client/src/lan/hub.rs` (+1 -0) 📝 `crates/horizon-client/tests/lan_bot.rs` (+1 -0) 📝 `tools/lan_e2e.py` (+81 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What A client of a server (single player on its server thread, a LAN guest, a dedicated server's player) only applied a rabbit's baby flag and a creeper's swell from `SetEntityData`. It now reads what vanilla's `onSyncedDataUpdated` reads: - Entity's on-fire flag - LivingEntity's health (the wither's boss bar follows it) - the baby flag of every ageable mob - `Sheep.DATA_WOOL_ID` - TamableAnimal's sitting and tame flags - the wolf's and cat's collar colour, which starts at vanilla's red - the size of the cube mobs (slime, magma cube) On the server side: - The server sends the collar colour. - Pairing still carries only non-default values. A mob's state now also lists the defaults of the entries that can go back to them (health, baby, wool, collar). When one does, the tracker sends that default, so a calf growing up and a sheep's wool growing back reach the clients. A unit test covers this. - Sheep saves wrote the colour and shearing state they were loaded with, and loads ignored both. Saves and loads now follow `Sheep.add/readAdditionalSaveData`. **Stacked:** first of 7 chained PRs (bugs-st-1). Merge order: #1421 → #1422 → #1423 → #1424 → #1425 → #1426 → #1427. Each one adds a check to `tools/lan_e2e.py`, so they are chained to avoid conflicts. Fixes #1367 Fixes #1368 Fixes #1369 Fixes #1370 Fixes #1371 Fixes #1385 Fixes #1390 ## Why Since #1265, single player's window is a remote client of its own server thread, as a LAN guest's is. Whatever the server doesn't send, single player no longer shows. This PR is part of the bugs-st-1 batch: visuals and entity data on the server thread. ## How tested New lan_e2e check `looks`, run in both modes. It summons a burning cow, a calf, a red sheared sheep, a size-4 slime, a tamed sitting wolf with a blue collar and a wither, then changes them (wither hurt, sheep dyed and its wool back, calf grown, fire out). The host and the guest must see every state. - main, server thread: FAIL. The host sees `cow@-5 burning False, wants True`, `cow@-3 baby False`, `sheep@1 color 0, sheared False`, `slime@3 size 1`, … - this branch: PASS, server thread and old mode. The latest runs after the final fixup passed 1/1 on the server thread and 3/3 in old mode. - `server_entities` parity harness: PASS (pairing data is unchanged against vanilla). Every check was run through `tools/lan_e2e.py` (`--server-thread` and old mode) on the Mac mini, from the top of the chain (`fix/st-particles`), which contains this PR. Self-check, run once on the top of the chain: **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at e325fa658, 4 min 27 s) | Check | Result | | --- | --- | | Scope | ⚠️ 37 files, +2165 −148; 2310 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 293 run, FAILED (errors=2) (20 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (13 s) | | tests: horizon-client, horizon-protocol | ✅ 1238 passed (3 min 39 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 103 affected, to run in CI (--quick): ambient_sound, arrow, audio_attributes, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_transformer, breaking_model, camera and 91 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Notes on the block: - **Python tests:** the 2 errors also happen on origin/main on this Mac, so they are not from this chain. - `test_parity_runner`: `java` exits 127 in the test's sandbox. - `test_rust_parity`: `/private/var` vs `/var` in `relative_to`. - **Parity:** the 103 affected harnesses ran in full at the top of the chain before a final rework of the entity defaults. 102 passed and `server_entities` failed. After the rework, `server_entities` was rerun and passes. Since then the chain has changed only one lan_e2e cleanup line (Python). ## Needs Ludovic Nothing beyond review. Merge in the chain order above. Each later PR's diff shrinks to its own commit once the earlier PRs are merged. 🤖 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:10:03 +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#3511
No description provided.