[PR #3411] [MERGED] Players wear their capes: CapeLayer, the cloak's swing, and the elytra in the cape's texture #4963

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3411
Author: @spidercraft
Created: 10/28/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: cape-rendering


📝 Commits (3)

  • e2b2b2c Players wear their capes: CapeLayer, the cloak's swing, and the elytra in the cape's texture
  • 3c514d5 Merge main into cape-rendering
  • 3497737 Merge main into this branch after the render crate split (#3186)

📊 Changes

9 files changed (+318 additions, -46 deletions)

View changed files

📝 crates/horizon-client-render/src/camera.rs (+59 -3)
📝 crates/horizon-client-render/src/skins.rs (+95 -9)
📝 crates/horizon-client/examples/probe/camera_probe.rs (+1 -1)
📝 crates/horizon-client/src/game/creatures.rs (+4 -9)
📝 crates/horizon-client/src/game/fov.rs (+1 -1)
📝 crates/horizon-client/src/game/perspective.rs (+70 -22)
📝 crates/horizon-client/src/game/remote.rs (+27 -1)
📝 crates/horizon-client/src/mobs.rs (+19 -0)
📝 crates/horizon-client/src/mobs/render.rs (+42 -0)

📄 Description

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

What and why

A player's cape texture was looked up and downloaded, then thrown away: nothing kept the image and nothing drew it. Players now wear their capes (feature):

  • Cape downloads go into the skin slots as capes/<sha1>, a 64x32 texture in the top half of a 64x64 slot. An evicted cape uploads again from memory or the disk cache. A larger cape is scaled to 64x32, and the older 22x17 fits as it is.
  • PlayerSkin.cape reaches the player models (other players and your own), which now load player#cape.
  • CapeLayer draws it: no cape under an elytra's wings, moved out over a chestplate, hidden by the Cape skin-customisation option (for the local player). The cape swings as in vanilla: it trails the player through ClientAvatarState's cloak, flaps when falling, sways with walking and stops leaning while gliding.
  • An elytra worn by a player with a cape takes the cape's texture.
  • HORIZON_OFFLINE_CAPE, which the launcher already sets for an offline name, becomes the local player's cape when the profile has none.

Not in this PR: other players' Cape option (Avatar.DATA_PLAYER_MODE_CUSTOMISATION, index 16) is left to #2971, which tracks it. Until then other players' capes always show.

Vanilla reference

Read from the 26.3 client's bytecode:

  • CapeLayer.submit, PlayerCapeModel.createCapeLayer / setupAnim, ModelPart.rotateBy
  • AvatarRenderer.extractCapeState (flap, lean, lean2), LivingEntityRenderState.fallFlyingScale
  • ClientAvatarState.tick / moveCloak / updateBob / resetBob, AbstractClientPlayer.tick / aiStep / rideTick, RemotePlayer.aiStep
  • SkinManager.TextureCache (skins/, capes/, elytra/ locations), WingsLayer.getPlayerElytraTexture

No harness covers capes. The unit tests camera::tests::the_cloak_trails_the_player and skins::tests::capes_fill_the_top_half_of_a_slot check the cloak and the cape image. camera_probe ticks ClientAvatarState at Vec3.ZERO, as its oracle does, so the camera harness's output is unchanged.

Checked in the game, signed in with a real profile's cape (cold and warm skin cache) and with HORIZON_OFFLINE_CAPE: standing, walking, strafing, sprint-flying, gliding, with an elytra (cape hidden, wings in the cape texture) and over an iron chestplate. Other players' capes over LAN were not run.

Self-check

pr_ready (tools/pr_ready.py on SpiderPC, against origin/main at 81f339814, 2 min 36 s)

Check Result
Scope ✅ 9 files, +318 −46
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 405 passed (23 s)
rustfmt ✅ (4 s)
clippy ✅ (55 s)
tests: horizon-client ✅ 1284 passed (1 min 1 s)
doc tests ✅ 0 passed (13 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 (no vanilla data here): 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/3411 **Author:** [@spidercraft](https://github.com/spidercraft) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `cape-rendering` --- ### 📝 Commits (3) - [`e2b2b2c`](https://github.com/horizon-rust/horizon/commit/e2b2b2ccd00226b76fe11b0ab187beffb7a799ef) Players wear their capes: CapeLayer, the cloak's swing, and the elytra in the cape's texture - [`3c514d5`](https://github.com/horizon-rust/horizon/commit/3c514d5c170d225ce54bcf17ab81fff9b99cf149) Merge main into cape-rendering - [`3497737`](https://github.com/horizon-rust/horizon/commit/3497737eccc511a8d301f2c1bec983b7a36faa89) Merge main into this branch after the render crate split (#3186) ### 📊 Changes **9 files changed** (+318 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/camera.rs` (+59 -3) 📝 `crates/horizon-client-render/src/skins.rs` (+95 -9) 📝 `crates/horizon-client/examples/probe/camera_probe.rs` (+1 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -9) 📝 `crates/horizon-client/src/game/fov.rs` (+1 -1) 📝 `crates/horizon-client/src/game/perspective.rs` (+70 -22) 📝 `crates/horizon-client/src/game/remote.rs` (+27 -1) 📝 `crates/horizon-client/src/mobs.rs` (+19 -0) 📝 `crates/horizon-client/src/mobs/render.rs` (+42 -0) </details> ### 📄 Description > 🤖 Opened by spidercraft's AI agent (Claude Code), not by spidercraft themself. ## What and why A player's cape texture was looked up and downloaded, then thrown away: nothing kept the image and nothing drew it. Players now wear their capes (`feature`): - Cape downloads go into the skin slots as `capes/<sha1>`, a 64x32 texture in the top half of a 64x64 slot. An evicted cape uploads again from memory or the disk cache. A larger cape is scaled to 64x32, and the older 22x17 fits as it is. - `PlayerSkin.cape` reaches the player models (other players and your own), which now load `player#cape`. - CapeLayer draws it: no cape under an elytra's wings, moved out over a chestplate, hidden by the Cape skin-customisation option (for the local player). The cape swings as in vanilla: it trails the player through ClientAvatarState's cloak, flaps when falling, sways with walking and stops leaning while gliding. - An elytra worn by a player with a cape takes the cape's texture. - `HORIZON_OFFLINE_CAPE`, which the launcher already sets for an offline name, becomes the local player's cape when the profile has none. Not in this PR: other players' Cape option (`Avatar.DATA_PLAYER_MODE_CUSTOMISATION`, index 16) is left to #2971, which tracks it. Until then other players' capes always show. ## Vanilla reference Read from the 26.3 client's bytecode: - `CapeLayer.submit`, `PlayerCapeModel.createCapeLayer` / `setupAnim`, `ModelPart.rotateBy` - `AvatarRenderer.extractCapeState` (flap, lean, lean2), `LivingEntityRenderState.fallFlyingScale` - `ClientAvatarState.tick` / `moveCloak` / `updateBob` / `resetBob`, `AbstractClientPlayer.tick` / `aiStep` / `rideTick`, `RemotePlayer.aiStep` - `SkinManager.TextureCache` (`skins/`, `capes/`, `elytra/` locations), `WingsLayer.getPlayerElytraTexture` No harness covers capes. The unit tests `camera::tests::the_cloak_trails_the_player` and `skins::tests::capes_fill_the_top_half_of_a_slot` check the cloak and the cape image. `camera_probe` ticks `ClientAvatarState` at `Vec3.ZERO`, as its oracle does, so the camera harness's output is unchanged. Checked in the game, signed in with a real profile's cape (cold and warm skin cache) and with `HORIZON_OFFLINE_CAPE`: standing, walking, strafing, sprint-flying, gliding, with an elytra (cape hidden, wings in the cape texture) and over an iron chestplate. Other players' capes over LAN were not run. ## Self-check **pr_ready** (`tools/pr_ready.py` on SpiderPC, against origin/main at 81f339814, 2 min 36 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +318 −46 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 405 passed (23 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (55 s) | | tests: horizon-client | ✅ 1284 passed (1 min 1 s) | | doc tests | ✅ 0 passed (13 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 (no vanilla data here): 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:09:13 +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#4963
No description provided.