[PR #426] [MERGED] LAN: every player wears their own armour #2556

Closed
opened 2026-11-02 15:57:11 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/426
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

Base: main ← Head: fix/lan-player-armour


📝 Commits (1)

  • 8e6a129 LAN: every player model wears its own armour

📊 Changes

4 files changed (+73 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/armor_stands.rs (+15 -10)
📝 crates/horizon-client/src/game/creatures.rs (+8 -1)
📝 crates/horizon-client/src/game/lan.rs (+11 -1)
📝 crates/horizon-client/src/game/remote.rs (+39 -0)

📄 Description

What

Each player model wears its own armour: the host draws a guest in the guest's armour, and a guest draws the host (and other guests) in theirs. Before, every other player wore the viewer's own armour.

Why

Every player model was drawn with player_armor_layers(), which reads the local player's armour slots, so each side dressed everyone in its own armour. Vanilla's HumanoidArmorLayer reads each avatar's equipment, sent to other clients with ClientboundSetEquipmentPacket (slots 2 feet, 3 legs, 4 chest, 5 head).

How

  • worn_armor_layers(&Mob) builds the layers from the model's own extra.head/chest/legs/feet; player_armor_layers() now goes through the same private armor_layers.
  • Host: lan_update_models copies each guest's armour into the guest's model, and the guest model draws its own held items.
  • Guest: a SetEquipment handler fills the mob's equipment by slot. creatures.rs draws minecraft:player mobs with their own armour.
  • lan status (model_armor) and the guest's status.server (player_equipment) report it for the test.

How tested

Two-client test (tools/lan_e2e.py, its own PR, #424): a host and a guest, both real games offscreen on the Mac mini, the guest joining over 127.0.0.1. Each check is reported on its own, with screenshots of both sides.

check origin/main this branch alone all six fixes merged
armour FAIL (the other player wears none of his own armour) PASS PASS

Screenshots, before and after, both sides: ~/code/horizon-parity/shots/lan/ (before-*, *-after-*, after-all-*).

Self-check on the integration commit (origin/main + the six LAN fixes):

cargo fmt --all --check                                       clean
cargo clippy --workspace --all-targets -- -D warnings         clean (exit 0)
cargo test -p horizon-client                                  743 passed, 0 failed
tools/parity.py --changed origin/main                         81 harnesses depend on the change: 81 passed, 0 failed

What needs Ludovic

  • Nothing to decide. Not tested: two physical machines (every run was host and guest on one Mac over loopback).

Fixes #366 (one of six PRs; merge order: self-model, armour, chest lids, name tags, crafting, damage, then the test).

🤖 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/426 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/15/2026 **Status:** ✅ Merged **Merged:** 10/15/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/lan-player-armour` --- ### 📝 Commits (1) - [`8e6a129`](https://github.com/horizon-rust/horizon/commit/8e6a129f6b6ab1fabd52f85aee940f07a9cc813d) LAN: every player model wears its own armour ### 📊 Changes **4 files changed** (+73 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/armor_stands.rs` (+15 -10) 📝 `crates/horizon-client/src/game/creatures.rs` (+8 -1) 📝 `crates/horizon-client/src/game/lan.rs` (+11 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+39 -0) </details> ### 📄 Description ## What Each player model wears its own armour: the host draws a guest in the guest's armour, and a guest draws the host (and other guests) in theirs. Before, every other player wore the viewer's own armour. ## Why Every player model was drawn with `player_armor_layers()`, which reads the local player's armour slots, so each side dressed everyone in its own armour. Vanilla's `HumanoidArmorLayer` reads each avatar's equipment, sent to other clients with `ClientboundSetEquipmentPacket` (slots 2 feet, 3 legs, 4 chest, 5 head). ## How - `worn_armor_layers(&Mob)` builds the layers from the model's own `extra.head/chest/legs/feet`; `player_armor_layers()` now goes through the same private `armor_layers`. - Host: `lan_update_models` copies each guest's armour into the guest's model, and the guest model draws its own held items. - Guest: a `SetEquipment` handler fills the mob's equipment by slot. `creatures.rs` draws `minecraft:player` mobs with their own armour. - `lan status` (`model_armor`) and the guest's `status.server` (`player_equipment`) report it for the test. ## How tested **Two-client test** (`tools/lan_e2e.py`, its own PR, #424): a host and a guest, both real games offscreen on the Mac mini, the guest joining over `127.0.0.1`. Each check is reported on its own, with screenshots of both sides. | check | origin/main | this branch alone | all six fixes merged | |---|---|---|---| | armour | FAIL (the other player wears none of his own armour) | PASS | PASS | Screenshots, before and after, both sides: `~/code/horizon-parity/shots/lan/` (`before-*`, `*-after-*`, `after-all-*`). **Self-check** on the integration commit (origin/main + the six LAN fixes): ``` cargo fmt --all --check clean cargo clippy --workspace --all-targets -- -D warnings clean (exit 0) cargo test -p horizon-client 743 passed, 0 failed tools/parity.py --changed origin/main 81 harnesses depend on the change: 81 passed, 0 failed ``` ## What needs Ludovic - Nothing to decide. Not tested: two physical machines (every run was host and guest on one Mac over loopback). Fixes #366 (one of six PRs; merge order: self-model, armour, chest lids, name tags, crafting, damage, then the test). 🤖 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-02 15:57:11 +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#2556
No description provided.