[PR #3792] [MERGED] Player entities keep the skin they found: NPCs show theirs #5218

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3792
Author: @GIGABAIT93
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/npc-skins


📝 Commits (3)

  • 731896f Player entities keep the skin they found: NPCs show theirs
  • 91591e4 Player skins: skin_entries as a function, with a test
  • ba5585d Merge main into fix/npc-skins (resolve crates/horizon-client/src/game/remote.rs)

📊 Changes

1 file changed (+83 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+83 -6)

📄 Description

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

What and why

NPCs from server plugins showed their skin for about two seconds after joining, then a default one. Logged on tensa.co.ua (signed in, Windows): the server adds each NPC's profile with a signed textures property (NPC22d10910-c770 and four more), the entities resolve their downloaded skins at 17:50:31, and at 17:50:33 the plugin removes the entries (PlayerInfoRemove, to keep NPCs off the tab list); right after, the same entities drew entity/player/slim/efe, zuri, sunny, wide/kai.

Vanilla keeps them: AbstractClientPlayer.getPlayerInfo looks the PlayerInfo up once and stores it in the entity's playerInfo field (checked in the 26.3 jar), and getSkin reads it from there, list entry or not. Here PlayerInfoRemove dropped skin_textures for the profile, and update_remote_skins resolved every player by its profile UUID from that map.

  • level_player_textures: per player entity, the textures it found first, as level_player_names already keeps its name for the same reason. It is filled lazily, as getPlayerInfo is (so an entity spawned before its entry takes it when it arrives), and forgotten when the entity is added again or removed, and on a new level.
  • skin_entries holds that lookup: every listed entry's textures, plus the kept ones of player entities whose entry is gone. update_remote_skins resolves from it, unchanged otherwise (the same lookup, signature rule and downloads).
  • Test a_player_entity_keeps_the_skin_its_entry_gave: an NPC plugin's add, spawn and remove; an entry arriving after its entity; a removed entity.

Checked in the game on tensa.co.ua, signed in: 15 seconds after joining, every NPC still shows its own skin.

The tab list still drops removed entries, as vanilla does; only the entities keep the profile.

Suggested label: none (a fix).

Vanilla reference

AbstractClientPlayer.getPlayerInfo and getSkin, ClientPacketListener.handlePlayerInfoRemove, PlayerInfo.getSkin. No harness covers a server's player list and skins.

Self-check

Run on Linux (WSL2).

pr_ready (tools/pr_ready.py --quick --base upstream/main on GIGABAIT, against upstream/main at de8ffbb29, 4 min 11 s)

Check Result
Scope ✅ 1 files, +83 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 416 passed (45 s)
rustfmt ✅ (40 s)
clippy ✅ (1 min 26 s)
tests: horizon-client ✅ 837 passed (1 min 14 s)
doc tests ✅ 0 passed (5 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): 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)

🤖 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/3792 **Author:** [@GIGABAIT93](https://github.com/GIGABAIT93) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/npc-skins` --- ### 📝 Commits (3) - [`731896f`](https://github.com/horizon-rust/horizon/commit/731896f222ad35c044a32c36ab2364b60a554637) Player entities keep the skin they found: NPCs show theirs - [`91591e4`](https://github.com/horizon-rust/horizon/commit/91591e4dcfca2e10a3e54dd5c2d1511c31143fe2) Player skins: skin_entries as a function, with a test - [`ba5585d`](https://github.com/horizon-rust/horizon/commit/ba5585da84b52064b0039ba1a778084c791f1129) Merge main into fix/npc-skins (resolve crates/horizon-client/src/game/remote.rs) ### 📊 Changes **1 file changed** (+83 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+83 -6) </details> ### 📄 Description > 🤖 Opened by GIGABAIT93's AI agent (Claude Code, Claude Opus 5.5), not by GIGABAIT93 directly. ## What and why NPCs from server plugins showed their skin for about two seconds after joining, then a default one. Logged on tensa.co.ua (signed in, Windows): the server adds each NPC's profile with a signed `textures` property (`NPC22d10910-c770` and four more), the entities resolve their downloaded skins at 17:50:31, and at 17:50:33 the plugin removes the entries (`PlayerInfoRemove`, to keep NPCs off the tab list); right after, the same entities drew `entity/player/slim/efe`, `zuri`, `sunny`, `wide/kai`. Vanilla keeps them: `AbstractClientPlayer.getPlayerInfo` looks the `PlayerInfo` up once and stores it in the entity's `playerInfo` field (checked in the 26.3 jar), and `getSkin` reads it from there, list entry or not. Here `PlayerInfoRemove` dropped `skin_textures` for the profile, and `update_remote_skins` resolved every player by its profile UUID from that map. - `level_player_textures`: per player entity, the `textures` it found first, as `level_player_names` already keeps its name for the same reason. It is filled lazily, as `getPlayerInfo` is (so an entity spawned before its entry takes it when it arrives), and forgotten when the entity is added again or removed, and on a new level. - `skin_entries` holds that lookup: every listed entry's textures, plus the kept ones of player entities whose entry is gone. `update_remote_skins` resolves from it, unchanged otherwise (the same `lookup`, signature rule and downloads). - Test `a_player_entity_keeps_the_skin_its_entry_gave`: an NPC plugin's add, spawn and remove; an entry arriving after its entity; a removed entity. Checked in the game on tensa.co.ua, signed in: 15 seconds after joining, every NPC still shows its own skin. The tab list still drops removed entries, as vanilla does; only the entities keep the profile. Suggested label: none (a fix). ## Vanilla reference `AbstractClientPlayer.getPlayerInfo` and `getSkin`, `ClientPacketListener.handlePlayerInfoRemove`, `PlayerInfo.getSkin`. No harness covers a server's player list and skins. ## Self-check Run on Linux (WSL2). **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on GIGABAIT, against upstream/main at de8ffbb29, 4 min 11 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +83 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 416 passed (45 s) | | rustfmt | ✅ (40 s) | | clippy | ✅ (1 min 26 s) | | tests: horizon-client | ✅ 837 passed (1 min 14 s) | | doc tests | ✅ 0 passed (5 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): 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) | 🤖 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 05:11:02 +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#5218
No description provided.