[GH-ISSUE #4280] Player model dissapears after changing resource packs #1257

Closed
opened 2026-11-02 15:45:27 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @ScrapDrawer22 on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4280

Changing resource packs makes player model dissapear in both F5 and in invetory

Originally created by @ScrapDrawer22 on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4280 Changing resource packs makes player model dissapear in both F5 and in invetory
Author
Owner

@sirrayi commented on GitHub (Oct 31, 2026):

🤖 Agent: #4280, #3122 and #3694 are one defect, and I have a fix working locally; I cannot claim another issue (the claim limit), so here is the analysis.

Root cause. Player skins have no texture of their own: a skin is uploaded into one of the 128 horizon/skinN regions of the shared HUD atlas and aliased under its location string (game/remote.rs:4017 store_skin). apply_staged_pack (game/packs.rs:252) swaps in a freshly built self.gui — a new HudAtlas at :299 — but does not reset self.skin_slots, and the new atlas only has the blank horizon/skinN regions (horizon-client-render/src/hud.rs:354), not the aliases. So after a reload every skin alias is gone from gui.atlas.sprites.

  • skins/… and capes/… recover, because again_skin (remote.rs:4050) treats "slot held but sprite absent" as missing and re-queues the download.
  • horizon/offline_skin and capes/offline do not: they are stored behind if !self.skin_slots.contains(OFFLINE) (remote.rs:3873 and :3886), which is still true after the reload, so store_skin never runs again and drawn_skin hands out a location with no sprite. Every consumer falls back to Steve — mobs/render.rs:1571 for the body, game.rs:11716 for the hand — which is what the report sees in F5, the inventory preview and first person.

d2e26c32d ("Players with a missing skin sprite draw the default skin, not nothing") already changed the visible symptom from "the body vanishes" to "the body is Steve" and added the skins/ self-heal; the offline skin is still lost.

Fix. Make those two guards reload-aware, mirroring again_skin: a location counts as held only when the slot is allocated and the atlas still has its sprite, so the reload re-stores them. SkinSlots::place returns the existing slot for a known location without evicting, so re-storing is idempotent. About four lines in update_remote_skins, plus the same for capes/offline. Do not touch SkinSlots::next_frame — the LRU with kept is the one place a mistake costs every player's skin.

In-game check for a maintainer, one minute: launch, look at yourself in F5, switch a resource pack, look again — before the fix the second look is a default skin.

<!-- gh-comment-id:6537507197 --> @sirrayi commented on GitHub (Oct 31, 2026): 🤖 Agent: #4280, #3122 and #3694 are one defect, and I have a fix working locally; I cannot claim another issue (the claim limit), so here is the analysis. **Root cause.** Player skins have no texture of their own: a skin is uploaded into one of the 128 `horizon/skinN` regions of the shared **HUD atlas** and aliased under its location string (`game/remote.rs:4017` `store_skin`). `apply_staged_pack` (`game/packs.rs:252`) swaps in a freshly built `self.gui` — a new `HudAtlas` at `:299` — but does **not** reset `self.skin_slots`, and the new atlas only has the blank `horizon/skinN` regions (`horizon-client-render/src/hud.rs:354`), not the aliases. So after a reload every skin alias is gone from `gui.atlas.sprites`. - `skins/…` and `capes/…` recover, because `again_skin` (`remote.rs:4050`) treats "slot held but sprite absent" as missing and re-queues the download. - `horizon/offline_skin` and `capes/offline` do not: they are stored behind `if !self.skin_slots.contains(OFFLINE)` (`remote.rs:3873` and `:3886`), which is still true after the reload, so `store_skin` never runs again and `drawn_skin` hands out a location with no sprite. Every consumer falls back to Steve — `mobs/render.rs:1571` for the body, `game.rs:11716` for the hand — which is what the report sees in F5, the inventory preview and first person. `d2e26c32d` ("Players with a missing skin sprite draw the default skin, not nothing") already changed the visible symptom from "the body vanishes" to "the body is Steve" and added the `skins/` self-heal; the offline skin is still lost. **Fix.** Make those two guards reload-aware, mirroring `again_skin`: a location counts as held only when the slot is allocated **and** the atlas still has its sprite, so the reload re-stores them. `SkinSlots::place` returns the existing slot for a known location without evicting, so re-storing is idempotent. About four lines in `update_remote_skins`, plus the same for `capes/offline`. Do not touch `SkinSlots::next_frame` — the LRU with `kept` is the one place a mistake costs every player's skin. In-game check for a maintainer, one minute: launch, look at yourself in F5, switch a resource pack, look again — before the fix the second look is a default skin.
Author
Owner

@kacpherek commented on GitHub (Oct 31, 2026):

Duplicate of #3122 (player skin lost after a resource pack reload); please follow that issue.

<!-- gh-comment-id:6541530725 --> @kacpherek commented on GitHub (Oct 31, 2026): Duplicate of #3122 (player skin lost after a resource pack reload); please follow that issue.
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#1257
No description provided.