[PR #3960] [MERGED] Skins and maps upload again after a resource pack reload #5323

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3960
Author: @Joansitoh
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/skins-after-pack-reload


📝 Commits (2)

  • f4c6f8d Skins and maps upload again after a resource pack reload
  • 7ee905e Merge upstream/main into fix/skins-after-pack-reload

📊 Changes

5 files changed (+122 additions, -19 deletions)

View changed files

📝 crates/horizon-client-render/src/skins.rs (+23 -0)
📝 crates/horizon-client/src/game.rs (+1 -0)
➕ crates/horizon-client/src/game/atlas_slots.rs (+73 -0)
📝 crates/horizon-client/src/game/maps.rs (+21 -19)
📝 crates/horizon-client/src/game/packs.rs (+4 -0)

📄 Description

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

What and why

After a resource pack reload (F3+T, or changing packs in the screen without restarting) the player's skin is gone: Steve's hand in first person, no model in F5 or the inventory, NPCs without their skin (#3122, #3694; the skin half of #3385).

Root cause, as d3grando found in #3277: a reload replaces the GUI atlas with a new one whose horizon/skin{N} and horizon/map{N} slots are blank and which has no skins/<digest> sprites, but Game keeps its slot tables. show_skin still answers yes, again_skin never queues the image again, and the player model names a sprite the new atlas does not have, so it draws nothing. Maps have the same table and the same fault.

The skin and map tables were the same LRU written twice. They are now one AtlasSlots type (game/atlas_slots.rs), and apply_staged_pack forgets both when it swaps the atlas. A forgotten skin is queued again by again_skin; a forgotten map gets a new slot and is marked texture_dirty, so it uploads again too. trim_slots needs nothing: it already drops entries whose sprite is missing.

This is #3663 by aangeraakt (split out of #3277, closed unmerged with no comment), rebased onto current main; it applied without changes. Credit to aangeraakt for the change and to d3grando for the diagnosis.

Refs, not Fixes: reporters on #3122 say rejoining the world does not bring the skin back either, and this change does not cover that.

Vanilla reference

Horizon-only: vanilla keeps skins in their own DynamicTextures, which a resource reload does not touch. Horizon puts them in fixed GUI-atlas slots, so it has to forget them when that atlas is rebuilt.

Self-check

tools/pr_ready.py --base origin/main --quick, Windows 11:

Check Result
Scope ✅ 5 files, +106 −36
Cargo.lock ✅ unchanged
Public tree ✅
rustfmt ✅
tests: horizon-client ✅ 866 passed, including game::atlas_slots::tests::a_new_atlas_shows_no_stored_skin
doc tests ✅
clippy ❌ horizon-world (lib test) does not compile on main; no file of this PR is in that crate
Python tests ❌ 1 error, UnicodeEncodeError on Windows; no Python is touched

The game was started on this branch with two players, one named SantiiagoAbascal; I did not verify the skins on screen myself, the person who asked for the change tried it.

Screenshots

None attached.

🤖 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/3960 **Author:** [@Joansitoh](https://github.com/Joansitoh) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/skins-after-pack-reload` --- ### 📝 Commits (2) - [`f4c6f8d`](https://github.com/horizon-rust/horizon/commit/f4c6f8dc29e8544a36c6bf4c322ef19f6ac8e808) Skins and maps upload again after a resource pack reload - [`7ee905e`](https://github.com/horizon-rust/horizon/commit/7ee905eab25353718f6293f4e73e81aea90fa2e0) Merge upstream/main into fix/skins-after-pack-reload ### 📊 Changes **5 files changed** (+122 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/skins.rs` (+23 -0) 📝 `crates/horizon-client/src/game.rs` (+1 -0) ➕ `crates/horizon-client/src/game/atlas_slots.rs` (+73 -0) 📝 `crates/horizon-client/src/game/maps.rs` (+21 -19) 📝 `crates/horizon-client/src/game/packs.rs` (+4 -0) </details> ### 📄 Description > 🤖 Opened by Joansitoh's AI agent (Claude Code), not by Joansitoh. ## What and why After a resource pack reload (F3+T, or changing packs in the screen without restarting) the player's skin is gone: Steve's hand in first person, no model in F5 or the inventory, NPCs without their skin (#3122, #3694; the skin half of #3385). Root cause, as d3grando found in #3277: a reload replaces the GUI atlas with a new one whose `horizon/skin{N}` and `horizon/map{N}` slots are blank and which has no `skins/<digest>` sprites, but `Game` keeps its slot tables. `show_skin` still answers yes, `again_skin` never queues the image again, and the player model names a sprite the new atlas does not have, so it draws nothing. Maps have the same table and the same fault. The skin and map tables were the same LRU written twice. They are now one `AtlasSlots` type (`game/atlas_slots.rs`), and `apply_staged_pack` forgets both when it swaps the atlas. A forgotten skin is queued again by `again_skin`; a forgotten map gets a new slot and is marked `texture_dirty`, so it uploads again too. `trim_slots` needs nothing: it already drops entries whose sprite is missing. This is #3663 by aangeraakt (split out of #3277, closed unmerged with no comment), rebased onto current `main`; it applied without changes. Credit to aangeraakt for the change and to d3grando for the diagnosis. Refs, not Fixes: reporters on #3122 say rejoining the world does not bring the skin back either, and this change does not cover that. ## Vanilla reference Horizon-only: vanilla keeps skins in their own `DynamicTexture`s, which a resource reload does not touch. Horizon puts them in fixed GUI-atlas slots, so it has to forget them when that atlas is rebuilt. ## Self-check `tools/pr_ready.py --base origin/main --quick`, Windows 11: | Check | Result | | --- | --- | | Scope | ✅ 5 files, +106 −36 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | rustfmt | ✅ | | tests: horizon-client | ✅ 866 passed, including `game::atlas_slots::tests::a_new_atlas_shows_no_stored_skin` | | doc tests | ✅ | | clippy | ❌ `horizon-world` (lib test) does not compile on `main`; no file of this PR is in that crate | | Python tests | ❌ 1 error, `UnicodeEncodeError` on Windows; no Python is touched | The game was started on this branch with two players, one named SantiiagoAbascal; I did not verify the skins on screen myself, the person who asked for the change tried it. ## Screenshots None attached. 🤖 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:47 +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#5323
No description provided.