[PR #7207] [MERGED] Send a player's own shoulder parrots to its client #7411

Closed
opened 2026-11-03 06:39:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7207
Author: @DUzzL
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/7136-shoulder-parrot


📝 Commits (1)

  • 7090fdd Send a player's own shoulder parrots to its client

📊 Changes

2 files changed (+41 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/lan/guest.rs (+4 -0)
📝 crates/horizon-client/src/lan/hub.rs (+37 -0)

📄 Description

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

Fixes #7136

What / why

A parrot on the player's own shoulder was never drawn in singleplayer (and on a world this game hosts). The own client reads Player.DATA_SHOULDER_PARROT_LEFT/RIGHT (ids 19/20) from the server, but the hub only put them in the entity data of players seen by others; a player is never tracked by itself, so its own client kept [None, None]. Vanilla ServerEntity.sendDirtyEntityData sends the owner its own dirty data too. The hub now does that for the two shoulder slots (Hub per-guest tick, next to the shared-flags send), resent as 0 / variant+1 when a slot changes and reset on respawn.

Vanilla reference

ParrotOnShoulderLayer.submit/submitOnShoulder (translate 0.4/-0.4, -1.5/-1.3 crouching, ParrotModel.Pose.ON_SHOULDER, ParrotRenderer.getVariantTexture), Player.extractParrotVariant (Parrot.Variant.LEGACY_CODEC), Player.getShoulderParrotLeft/Right, ServerPlayer.handleShoulderEntities. The rendering code already matched; spectator gating (layers_shown, AvatarRenderer.shouldRenderLayers) is not the cause (not a spectator).

Verification

  • Before (nightly-equivalent main, fresh singleplayer world, tame blue parrot landed on the shoulder, data get entity @s ShoulderEntityLeft holds it, F5 third person): no parrot on the model; debug logging showed the own model's shoulder_parrots always [None, None] while the server's guest had [Some(1), ..].
  • After: parrots drawn on the shoulder in third person (screenshot taken with horizon-ctl).
  • New unit test lan::hub::tests::the_owner_is_sent_the_shoulder_slots_that_changed.
  • Not covered: first person draws no own model (vanilla too); other players' shoulder parrots already synced.

pr_ready (--quick, Windows)

Check Result
Scope ✅ 2 files, +41
Python tests ✅ 612 passed
clippy ✅
tests: horizon-client-lib ✅ 1419 passed
doc tests ✅
rustfmt ✅ after cargo fmt --all (first quick run flagged one signature, fixed in this commit)
Parity ➖ 92 affected, left to CI (--quick)

🔄 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/7207 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/7136-shoulder-parrot` --- ### 📝 Commits (1) - [`7090fdd`](https://github.com/horizon-rust/horizon/commit/7090fdd5ccb25e0bb560ae67b68374580e4286d9) Send a player's own shoulder parrots to its client ### 📊 Changes **2 files changed** (+41 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/lan/guest.rs` (+4 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+37 -0) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself. Fixes #7136 ## What / why A parrot on the player's own shoulder was never drawn in singleplayer (and on a world this game hosts). The own client reads `Player.DATA_SHOULDER_PARROT_LEFT/RIGHT` (ids 19/20) from the server, but the hub only put them in the entity data of players seen by *others*; a player is never tracked by itself, so its own client kept `[None, None]`. Vanilla `ServerEntity.sendDirtyEntityData` sends the owner its own dirty data too. The hub now does that for the two shoulder slots (`Hub` per-guest tick, next to the shared-flags send), resent as 0 / variant+1 when a slot changes and reset on respawn. ## Vanilla reference `ParrotOnShoulderLayer.submit/submitOnShoulder` (translate 0.4/-0.4, -1.5/-1.3 crouching, `ParrotModel.Pose.ON_SHOULDER`, `ParrotRenderer.getVariantTexture`), `Player.extractParrotVariant` (`Parrot.Variant.LEGACY_CODEC`), `Player.getShoulderParrotLeft/Right`, `ServerPlayer.handleShoulderEntities`. The rendering code already matched; spectator gating (`layers_shown`, `AvatarRenderer.shouldRenderLayers`) is not the cause (not a spectator). ## Verification - Before (nightly-equivalent main, fresh singleplayer world, tame blue parrot landed on the shoulder, `data get entity @s ShoulderEntityLeft` holds it, F5 third person): no parrot on the model; debug logging showed the own model's `shoulder_parrots` always `[None, None]` while the server's guest had `[Some(1), ..]`. - After: parrots drawn on the shoulder in third person (screenshot taken with horizon-ctl). - New unit test `lan::hub::tests::the_owner_is_sent_the_shoulder_slots_that_changed`. - Not covered: first person draws no own model (vanilla too); other players' shoulder parrots already synced. ## pr_ready (`--quick`, Windows) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +41 | | Python tests | ✅ 612 passed | | clippy | ✅ | | tests: horizon-client-lib | ✅ 1419 passed | | doc tests | ✅ | | rustfmt | ✅ after `cargo fmt --all` (first quick run flagged one signature, fixed in this commit) | | Parity | ➖ 92 affected, left to CI (--quick) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:39:08 +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#7411
No description provided.