[PR #428] [MERGED] LAN: name tags over other players, and the host under its own name #2559

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/428
Author: @ludovic111
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/15/2026
Merged by: @ludovic111

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


📝 Commits (1)

  • 9948ff4 LAN: other players' name tags, and the host under its own name

📊 Changes

5 files changed (+115 additions, -32 deletions)

View changed files

📝 crates/horizon-client/src/game/control.rs (+4 -0)
📝 crates/horizon-client/src/game/lan.rs (+11 -5)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -1)
📝 crates/horizon-client/src/game/names.rs (+87 -26)
📝 crates/horizon-client/src/game/remote.rs (+12 -0)

📄 Description

What

Other players have name tags on LAN, and the host plays under its own profile name instead of "Player": in the guest's Tab list, in chat, in the LAN MOTD, in /list and in its offline UUID.

Why

Name tags were drawn only for mobs with a custom name under the crosshair, so other players had none. Vanilla LivingEntityRenderer.shouldShowName shows a player's name whenever the player is visible to the viewer. It is drawn discreetly and only within 32 blocks when the player is crouching, and team visibility and below-name scores apply. The host's name was the PLAYER_NAME constant, so guests saw "Player".

How

  • names.rs: name_tags() gathers named mobs and players (the host's guest models, and on a guest remote_player_names() from the server's player list). name_tag_geometry draws from it. below_name_text takes the holder's name.
  • LanHost.host_name comes from options.player_name() and is used for the MOTD, the offline UUID, the host's HostState, hub chat and /list.
  • status.name_tags and lan status's host 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
tab PASS, but the host is "Player" PASS (Guest, Player33006) PASS
nametags FAIL (none on either side) 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/428 **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-nametags` --- ### 📝 Commits (1) - [`9948ff4`](https://github.com/horizon-rust/horizon/commit/9948ff42aa2424e4ae87717115a51b147d3e1183) LAN: other players' name tags, and the host under its own name ### 📊 Changes **5 files changed** (+115 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/control.rs` (+4 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+11 -5) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -1) 📝 `crates/horizon-client/src/game/names.rs` (+87 -26) 📝 `crates/horizon-client/src/game/remote.rs` (+12 -0) </details> ### 📄 Description ## What Other players have name tags on LAN, and the host plays under its own profile name instead of "Player": in the guest's Tab list, in chat, in the LAN MOTD, in `/list` and in its offline UUID. ## Why Name tags were drawn only for mobs with a custom name under the crosshair, so other players had none. Vanilla `LivingEntityRenderer.shouldShowName` shows a player's name whenever the player is visible to the viewer. It is drawn discreetly and only within 32 blocks when the player is crouching, and team visibility and below-name scores apply. The host's name was the `PLAYER_NAME` constant, so guests saw "Player". ## How - `names.rs`: `name_tags()` gathers named mobs and players (the host's guest models, and on a guest `remote_player_names()` from the server's player list). `name_tag_geometry` draws from it. `below_name_text` takes the holder's name. - `LanHost.host_name` comes from `options.player_name()` and is used for the MOTD, the offline UUID, the host's `HostState`, hub chat and `/list`. - `status.name_tags` and `lan status`'s `host` 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 | |---|---|---|---| | tab | PASS, but the host is "Player" | PASS (`Guest`, `Player33006`) | PASS | | nametags | FAIL (none on either side) | 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#2559
No description provided.