[PR #2851] [MERGED] A dyed leather armour keeps its colour (fixes #2774) #4656

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2851
Author: @levzzz5154
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/28/2026
Merged by: @ludovic111

Base: main ← Head: fix/dyed-armor-colour


📝 Commits (4)

  • 033c89a A dyed leather armour keeps its colour
  • 7b841af Merge the dyed armour colour fix onto upstream/main
  • 69bb386 Merge main into dyed-armor-colour
  • 95ecc9d Merge main into fix/dyed-armor-colour

📊 Changes

5 files changed (+87 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game/armor_stands.rs (+8 -1)
📝 crates/horizon-client/src/game/lan.rs (+16 -9)
📝 crates/horizon-client/src/game/remote.rs (+16 -4)
📝 crates/horizon-client/src/mobs.rs (+3 -0)
📝 crates/horizon-client/src/mobs/render.rs (+44 -6)

📄 Description

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

What and why

A dyed leather armour was drawn in the colour leather has when it is undyed, so a blue helmet showed brown; and another player's armour had no trim, because only the item id of the worn pieces was kept, not the stack. The vanilla tints a dyeable armour layer with the stack's dye colour (DataComponents.DYED_COLOR) and the colour it has when undyed otherwise, and draws the armour's trim as a layer over the armour.

This pull request keeps the worn armour's stack on the mob (head to feet), so the renderer sees the dye colour and the trim:

  • mobs.rs: the mob keeps the four worn armour stacks.
  • game/remote.rs: the equipment packet fills them, so the client learns the stacks the server sends.
  • game/lan.rs: the host sends the worn armour's stack, not just its id, so the guests see the same colour.
  • game/armor_stands.rs and mobs/render.rs: the armour layer takes the stack's dye colour, and another player's trim is drawn over the armour.

Fixes #2774

Vanilla reference

  • net.minecraft.client.renderer.entity.layers.EquipmentLayerRenderer.getColorForLayer - a layer with a dyeable block takes the stack's dye colour, the layer's color_when_undyed otherwise; a layer without it is not tinted.
  • net.minecraft.world.item.component.DyedItemColor.getOrDefault - the stack's minecraft:dyed_color as ARGB.opaque(color.rgb()); LEATHER_COLOR is -6265536, the colour leather has when undyed.
  • net.minecraft.client.renderer.entity.layers.EquipmentLayerRenderer.renderLayers - the trim (DataComponents.TRIM) is a layer of its own over the armour, with the pattern's texture and the material's palette.
  • assets/minecraft/equipment/leather.json - the leather layers carry dyeable.color_when_undyed (-6265536); the overlay layer carries none.
  • assets/minecraft/items/leather_helmet.json - the item's own model tints with minecraft:dye, the same rule for the item in the hand.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on cachyos-x8664, against upstream/main at 96f84abfe, 5 min 8 s)

Check Result
Scope ✅ 5 files, +86 −23
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 336 passed (18 s)
rustfmt ✅ (4 s)
clippy ✅ (52 s)
tests: horizon-client ✅ 1330 passed (2 min 47 s)
doc tests ✅ 0 passed (1 min 1 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 ➖ 75 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 63 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
  • cargo test --locked -p horizon-client --lib -- dyed_leather -> 1 passed (mobs::render::tests::a_dyed_leather_armour_keeps_its_colour).
  • Negative control: with the dye colour ignored in the tint, the new test fails - left: 4282410400 (the undyed leather colour) and right: 4294901760 (the dyed blue).
  • cargo fmt -p horizon-client -> no changes.

🤖 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/2851 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/28/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dyed-armor-colour` --- ### 📝 Commits (4) - [`033c89a`](https://github.com/horizon-rust/horizon/commit/033c89a1b2a1317fe936a9b50f8b5c1b454b0dcf) A dyed leather armour keeps its colour - [`7b841af`](https://github.com/horizon-rust/horizon/commit/7b841af0950c8aac1141d47749b70c240101a33d) Merge the dyed armour colour fix onto upstream/main - [`69bb386`](https://github.com/horizon-rust/horizon/commit/69bb386a6dbdd63e210d0c1a9d31e2c68ee69b2e) Merge main into dyed-armor-colour - [`95ecc9d`](https://github.com/horizon-rust/horizon/commit/95ecc9d771c123d3a72504cf8c20b2189965b02d) Merge main into fix/dyed-armor-colour ### 📊 Changes **5 files changed** (+87 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/armor_stands.rs` (+8 -1) 📝 `crates/horizon-client/src/game/lan.rs` (+16 -9) 📝 `crates/horizon-client/src/game/remote.rs` (+16 -4) 📝 `crates/horizon-client/src/mobs.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs/render.rs` (+44 -6) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code), not by levzzz5154 himself. ## What and why A dyed leather armour was drawn in the colour leather has when it is undyed, so a blue helmet showed brown; and another player's armour had no trim, because only the item id of the worn pieces was kept, not the stack. The vanilla tints a dyeable armour layer with the stack's dye colour (`DataComponents.DYED_COLOR`) and the colour it has when undyed otherwise, and draws the armour's trim as a layer over the armour. This pull request keeps the worn armour's stack on the mob (head to feet), so the renderer sees the dye colour and the trim: - `mobs.rs`: the mob keeps the four worn armour stacks. - `game/remote.rs`: the equipment packet fills them, so the client learns the stacks the server sends. - `game/lan.rs`: the host sends the worn armour's stack, not just its id, so the guests see the same colour. - `game/armor_stands.rs` and `mobs/render.rs`: the armour layer takes the stack's dye colour, and another player's trim is drawn over the armour. Fixes #2774 ## Vanilla reference - `net.minecraft.client.renderer.entity.layers.EquipmentLayerRenderer.getColorForLayer` - a layer with a `dyeable` block takes the stack's dye colour, the layer's `color_when_undyed` otherwise; a layer without it is not tinted. - `net.minecraft.world.item.component.DyedItemColor.getOrDefault` - the stack's `minecraft:dyed_color` as `ARGB.opaque(color.rgb())`; `LEATHER_COLOR` is -6265536, the colour leather has when undyed. - `net.minecraft.client.renderer.entity.layers.EquipmentLayerRenderer.renderLayers` - the trim (`DataComponents.TRIM`) is a layer of its own over the armour, with the pattern's texture and the material's palette. - `assets/minecraft/equipment/leather.json` - the leather layers carry `dyeable.color_when_undyed` (-6265536); the overlay layer carries none. - `assets/minecraft/items/leather_helmet.json` - the item's own model tints with `minecraft:dye`, the same rule for the item in the hand. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on cachyos-x8664, against upstream/main at 96f84abfe, 5 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +86 −23 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 336 passed (18 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (52 s) | | tests: horizon-client | ✅ 1330 passed (2 min 47 s) | | doc tests | ✅ 0 passed (1 min 1 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 | ➖ 75 affected, to run in CI (--quick): arrow, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, breaking_model, cauldron, command_exec, composter, crafter and 63 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | - `cargo test --locked -p horizon-client --lib -- dyed_leather` -> `1 passed` (`mobs::render::tests::a_dyed_leather_armour_keeps_its_colour`). - Negative control: with the dye colour ignored in the tint, the new test fails - `left: 4282410400` (the undyed leather colour) and `right: 4294901760` (the dyed blue). - `cargo fmt -p horizon-client` -> no changes. 🤖 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:06:58 +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#4656
No description provided.