[PR #1967] [MERGED] Render mannequin entities (server NPCs) #3895

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

📋 Pull Request Information

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

Base: main ← Head: fix/mannequin-npcs


📝 Commits (2)

  • ea1c0a4 Render mannequin entities (server NPCs)
  • d3af1e0 Mannequins run no mob goals and never despawn

📊 Changes

7 files changed (+263 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+62 -9)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+23 -0)
📝 crates/horizon-client/src/mobs.rs (+4 -0)
📝 crates/horizon-client/src/mobs/ai.rs (+8 -2)
📝 crates/horizon-client/src/mobs/render.rs (+9 -4)
📝 crates/horizon-client/src/mobs/species.rs (+14 -1)
📝 crates/horizon-protocol/src/entity_data.rs (+143 -0)

📄 Description

🤖 Opened by an AI agent (Devin), not by the user themselves.

Summary

Server NPCs spawned as minecraft:mannequin never rendered: MobTypes.load only builds species::ALL, so the ClientPacketListener.handleAddEntity path produced a tracked entity but no drawable — invisible NPCs (reported on gommehd.net, e.g. the "Gommunity" lobby NPC, which modern servers run as mannequins rather than fake players).

  • EntityDataSerializers.RESOLVABLE_PROFILE (41) now decodes to Value::Profile (ResolvableProfile.STREAM_CODEC: either a full GameProfile or a Partial, then PlayerSkin.Patch). Before, the entry list ended at the unknown serializer, so the mannequin's DATA_IMMOVABLE/DATA_DESCRIPTION after it never decoded.
  • species::ALL gains mannequin (player#main model, Humanoid anim), and the player-only render paths — skin texture, sleep pose, AvatarRenderer's 0.9375 scale — take an avatar() check instead of the id string.
  • SetEntityData's apply stores DATA_PROFILE on the mob; update_remote_skins resolves its textures property via PlayerSkinRenderCache.lookup rules (unsigned allowed — the SkinManager insecure path) through the same download pipeline as tab-list skins.
  • Mannequins also get the shared-flags crouch and sleeping-position handling other players already had.

Vanilla mirrored: net.minecraft.world.entity.decoration.Mannequin / client.entity.ClientMannequin, ResolvableProfile (+ Partial), PlayerSkin.Patch, ByteBufCodecs.{either,GAME_PROFILE_PROPERTIES}, PlayerSkinRenderCache, AvatarRenderer.

Test plan

  • python3 tools/pr_ready.py --quick — rustfmt, clippy and the 1351 horizon-client/horizon-protocol tests pass (output below), including two new tests: entity_data::tests::resolvable_profile_round_trips and remote_mob_data::tests::a_mannequin_exists_and_takes_its_profile.
  • Not exercised against a live server (needs a real account on gommehd.net); the codec is spec-verified against the decompiled 26.3 sources.

pr_ready (tools/pr_ready.py --quick on MacBookPro, against origin/main at 6df37324f, 3 min 32 s)

Check Result
Scope ✅ 7 files, +290 −14
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (6 s)
clippy ✅ (35 s)
tests: horizon-client, horizon-protocol ✅ 1351 passed (2 min 47 s)
doc tests ✅ 0 passed (3 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 284 affected, to run in CI (--quick)
Label fix (no label)

🤖 Generated with Devin


🔄 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/1967 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/mannequin-npcs` --- ### 📝 Commits (2) - [`ea1c0a4`](https://github.com/horizon-rust/horizon/commit/ea1c0a4490909d5af7beca6103642034eb463435) Render mannequin entities (server NPCs) - [`d3af1e0`](https://github.com/horizon-rust/horizon/commit/d3af1e04e01c1122c0647447dbb918dbf53277cf) Mannequins run no mob goals and never despawn ### 📊 Changes **7 files changed** (+263 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+62 -9) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+23 -0) 📝 `crates/horizon-client/src/mobs.rs` (+4 -0) 📝 `crates/horizon-client/src/mobs/ai.rs` (+8 -2) 📝 `crates/horizon-client/src/mobs/render.rs` (+9 -4) 📝 `crates/horizon-client/src/mobs/species.rs` (+14 -1) 📝 `crates/horizon-protocol/src/entity_data.rs` (+143 -0) </details> ### 📄 Description > 🤖 Opened by an AI agent (Devin), not by the user themselves. ## Summary Server NPCs spawned as `minecraft:mannequin` never rendered: `MobTypes.load` only builds `species::ALL`, so the `ClientPacketListener.handleAddEntity` path produced a tracked entity but no drawable — invisible NPCs (reported on gommehd.net, e.g. the "Gommunity" lobby NPC, which modern servers run as mannequins rather than fake players). - `EntityDataSerializers.RESOLVABLE_PROFILE` (41) now decodes to `Value::Profile` (`ResolvableProfile.STREAM_CODEC`: either a full `GameProfile` or a `Partial`, then `PlayerSkin.Patch`). Before, the entry list ended at the unknown serializer, so the mannequin's `DATA_IMMOVABLE`/`DATA_DESCRIPTION` after it never decoded. - `species::ALL` gains mannequin (`player#main` model, `Humanoid` anim), and the player-only render paths — skin texture, sleep pose, `AvatarRenderer`'s 0.9375 scale — take an `avatar()` check instead of the id string. - `SetEntityData`'s `apply` stores `DATA_PROFILE` on the mob; `update_remote_skins` resolves its `textures` property via `PlayerSkinRenderCache.lookup` rules (unsigned allowed — the `SkinManager` insecure path) through the same download pipeline as tab-list skins. - Mannequins also get the shared-flags crouch and sleeping-position handling other players already had. Vanilla mirrored: `net.minecraft.world.entity.decoration.Mannequin` / `client.entity.ClientMannequin`, `ResolvableProfile` (+ `Partial`), `PlayerSkin.Patch`, `ByteBufCodecs.{either,GAME_PROFILE_PROPERTIES}`, `PlayerSkinRenderCache`, `AvatarRenderer`. ## Test plan - `python3 tools/pr_ready.py --quick` — rustfmt, clippy and the 1351 horizon-client/horizon-protocol tests pass (output below), including two new tests: `entity_data::tests::resolvable_profile_round_trips` and `remote_mob_data::tests::a_mannequin_exists_and_takes_its_profile`. - Not exercised against a live server (needs a real account on gommehd.net); the codec is spec-verified against the decompiled 26.3 sources. **pr_ready** (`tools/pr_ready.py --quick` on MacBookPro, against origin/main at 6df37324f, 3 min 32 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +290 −14 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (6 s) | | clippy | ✅ (35 s) | | tests: horizon-client, horizon-protocol | ✅ 1351 passed (2 min 47 s) | | doc tests | ✅ 0 passed (3 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 284 affected, to run in CI (--quick) | | Label | fix (no label) | 🤖 Generated with Devin --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:05 +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#3895
No description provided.