[PR #1633] [MERGED] Multiplayer: show armour trims on items from a server #3648

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1633
Author: @some-du6e
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/remote-trims


📝 Commits (4)

  • 9223b40 Decode every item data component a server sends
  • 4ad05aa Show armour trims on items from a server
  • f07d66c Trims: their own arm in Component::read
  • a262970 Trims: a Horizon host sends them too

📊 Changes

9 files changed (+979 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+15 -0)
📝 crates/horizon-client/src/lan/guest.rs (+55 -4)
📝 crates/horizon-client/src/lan/hub.rs (+1 -1)
📝 crates/horizon-protocol/Cargo.toml (+4 -0)
➕ crates/horizon-protocol/examples/item_wire_probe.rs (+65 -0)
📝 crates/horizon-protocol/src/item.rs (+80 -3)
➕ crates/horizon-protocol/src/item/skip.rs (+427 -0)
➕ mods/horizon/src/test/java/dev/horizonlab/parity/VanillaItemWireOracle.java (+155 -0)
➕ tools/test_item_wire_parity.py (+177 -0)

📄 Description

🤖 Opened by some-du6e's AI agent (Claude Code, Claude Opus 5.5), not by some-du6e themselves.

Builds on #1631 (this branch contains its commit). Review only the last commit, "Show armour trims on items from a server". It will rebase down to that commit once #1631 merges.

What and why

After #1631, trimmed armour on a server loads, but it still shows without its trim. The trim component is only read past, so the item never gets item_data.trim, even though Horizon already draws trims in single player.

When both holders are references, the trim component now decodes as Component::Trim { material, pattern } (registry ids). The client names them through the server's synced trim_material and trim_pattern registries, the same way it already names enchantments. A trim with a direct (inline) material or pattern has no registry name, so it stays read past.

Vanilla reference

ArmorTrim.STREAM_CODEC: TrimMaterial.STREAM_CODEC and TrimPattern.STREAM_CODEC, each a ByteBufCodecs.holder (a reference is its id plus one). The item_wire harness now byte-compares trim stacks too (Trim re-encodes exactly, so the probe doesn't count it as a lossy typed decoder): all 374 stacks still match.

Self-check

pr_ready (tools/pr_ready.py --quick on swiss, against origin/main at 7fca3c2f9, 8 min 16 s)

Check Result
Scope ⚠️ 7 files, +917 −3; 588 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 287 passed (34 s)
rustfmt ✅ (8 s)
clippy ✅ (2 min 27 s)
tests: horizon-client, horizon-protocol ✅ 1257 passed (5 min 2 s)
doc tests ✅ 0 passed (4 s)
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)

The scope count includes #1631's commit; this PR's own commit is 3 files, +55 −9.

Tested on a Paper server: a trimmed chestplate shows its trim when worn and in the inventory.

Note

Filed by Claude Opus 5.5 using Claude Code, for some-du6e.

🤖 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/1633 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/remote-trims` --- ### 📝 Commits (4) - [`9223b40`](https://github.com/horizon-rust/horizon/commit/9223b401e7bb8864711e1f05c891b9d3187bbadb) Decode every item data component a server sends - [`4ad05aa`](https://github.com/horizon-rust/horizon/commit/4ad05aa94a4a1a7c4c9b4b39717a238af5d6584c) Show armour trims on items from a server - [`f07d66c`](https://github.com/horizon-rust/horizon/commit/f07d66c7cfa9b298b0e36b6035e2d9fe7ffc5eda) Trims: their own arm in Component::read - [`a262970`](https://github.com/horizon-rust/horizon/commit/a26297058a38c8817f07fc5ba6a7107cbc16f450) Trims: a Horizon host sends them too ### 📊 Changes **9 files changed** (+979 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+15 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+55 -4) 📝 `crates/horizon-client/src/lan/hub.rs` (+1 -1) 📝 `crates/horizon-protocol/Cargo.toml` (+4 -0) ➕ `crates/horizon-protocol/examples/item_wire_probe.rs` (+65 -0) 📝 `crates/horizon-protocol/src/item.rs` (+80 -3) ➕ `crates/horizon-protocol/src/item/skip.rs` (+427 -0) ➕ `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaItemWireOracle.java` (+155 -0) ➕ `tools/test_item_wire_parity.py` (+177 -0) </details> ### 📄 Description > 🤖 Opened by some-du6e's AI agent (Claude Code, Claude Opus 5.5), not by some-du6e themselves. **Builds on #1631** (this branch contains its commit). Review only the last commit, "Show armour trims on items from a server". It will rebase down to that commit once #1631 merges. ## What and why After #1631, trimmed armour on a server loads, but it still shows without its trim. The trim component is only read past, so the item never gets `item_data.trim`, even though Horizon already draws trims in single player. When both holders are references, the trim component now decodes as `Component::Trim { material, pattern }` (registry ids). The client names them through the server's synced `trim_material` and `trim_pattern` registries, the same way it already names enchantments. A trim with a direct (inline) material or pattern has no registry name, so it stays read past. ## Vanilla reference `ArmorTrim.STREAM_CODEC`: `TrimMaterial.STREAM_CODEC` and `TrimPattern.STREAM_CODEC`, each a `ByteBufCodecs.holder` (a reference is its id plus one). The `item_wire` harness now byte-compares trim stacks too (`Trim` re-encodes exactly, so the probe doesn't count it as a lossy typed decoder): all 374 stacks still match. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on swiss, against origin/main at 7fca3c2f9, 8 min 16 s) | Check | Result | | --- | --- | | Scope | ⚠️ 7 files, +917 −3; 588 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 287 passed (34 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (2 min 27 s) | | tests: horizon-client, horizon-protocol | ✅ 1257 passed (5 min 2 s) | | doc tests | ✅ 0 passed (4 s) | | 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) | The scope count includes #1631's commit; this PR's own commit is 3 files, +55 −9. Tested on a Paper server: a trimmed chestplate shows its trim when worn and in the inventory. > [!NOTE] > Filed by Claude Opus 5.5 using Claude Code, for some-du6e. 🤖 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 04:11:08 +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#3648
No description provided.