[PR #5466] [MERGED] Native server mods: nicknames in chat and the Tab list, and the chat filter's verdict #6302

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

📋 Pull Request Information

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

Base: main ← Head: feat/native-nicknames


📝 Commits (1)

  • 0f26235 Native server mods: nicknames in chat and the Tab list, and the chat filter's verdict

📊 Changes

3 files changed (+70 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/native_server.rs (+31 -0)
📝 crates/horizon-client/src/lan/hub.rs (+33 -3)
➕ tools/native-hook-fragments/native-nicknames.json (+6 -0)

📄 Description

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

Why

Ludovic wants nicknames on the official server (/nick, in the SMP mod: horizon-rust/horizon-mods native/smp).
A server mod can't change how a player's name shows in chat or the Tab list today, so this adds two small helpers.

What

  • native_set_nickname(uuid, Option<&str>) (native_server.rs): the hub keeps a nickname per UUID.
    • Hub::player_display_name (Player.getDisplayName: chat messages, /me, /msg) shows it in place of the name.
      The hover (show_entity), the suggested /tell and the insertion keep the real name.
    • The Tab list shows it (PlayerInfo UPDATE_DISPLAY_NAME, and in the entry new players get).
    • None shows the name again.
  • native_text_allowed(text): whether the server's chat filter (#5388) lets a text through. True without a
    filter, None inside a player's hook.
  • Both work outside a player's hook, like native_run_command. The API number comes from the fragment
    (tools/native-hook-fragments/native-nicknames.json) at the next stamp.
  • The real name stays everywhere else: the log, the anticheat, commands and selectors, the server's events (and so
    the Discord bridge). The GameProfile (name, UUID) never changes.
  • Without a mod calling it, nothing changes: the default path is the same display_name(uuid, name).

Proof

  • cargo clippy -p horizon-client --all-targets -D warnings: clean.

  • The SMP mod's native.py proof smp on this branch with the fragment stamped locally (feat/native-nicknames-stamped,
    API 58, not for merge), with a dedicated server and two real clients:

    • Steve /nick Rocky;
    • Alex's chat shows Steve's message under Rocky;
    • the Tab list shows Rocky (screenshot);
    • /realname Rocky says Steve;
    • an operator's /nick Steve off brings the name back in chat.

    Results in a comment below.

🤖 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/5466 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/native-nicknames` --- ### 📝 Commits (1) - [`0f26235`](https://github.com/horizon-rust/horizon/commit/0f262358898b608e6f0843df289be5926b83ed2a) Native server mods: nicknames in chat and the Tab list, and the chat filter's verdict ### 📊 Changes **3 files changed** (+70 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/native_server.rs` (+31 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+33 -3) ➕ `tools/native-hook-fragments/native-nicknames.json` (+6 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## Why Ludovic wants nicknames on the official server (`/nick`, in the SMP mod: horizon-rust/horizon-mods `native/smp`). A server mod can't change how a player's name shows in chat or the Tab list today, so this adds two small helpers. ## What - `native_set_nickname(uuid, Option<&str>)` (`native_server.rs`): the hub keeps a nickname per UUID. - `Hub::player_display_name` (Player.getDisplayName: chat messages, `/me`, `/msg`) shows it in place of the name. The hover (`show_entity`), the suggested `/tell` and the insertion keep the real name. - The Tab list shows it (`PlayerInfo` `UPDATE_DISPLAY_NAME`, and in the entry new players get). - None shows the name again. - `native_text_allowed(text)`: whether the server's chat filter (#5388) lets a text through. True without a filter, None inside a player's hook. - Both work outside a player's hook, like `native_run_command`. The API number comes from the fragment (`tools/native-hook-fragments/native-nicknames.json`) at the next stamp. - The real name stays everywhere else: the log, the anticheat, commands and selectors, the server's events (and so the Discord bridge). The GameProfile (name, UUID) never changes. - Without a mod calling it, nothing changes: the default path is the same `display_name(uuid, name)`. ## Proof - `cargo clippy -p horizon-client --all-targets -D warnings`: clean. - The SMP mod's `native.py proof smp` on this branch with the fragment stamped locally (`feat/native-nicknames-stamped`, API 58, not for merge), with a dedicated server and two real clients: - Steve `/nick Rocky`; - Alex's chat shows Steve's message under Rocky; - the Tab list shows Rocky (screenshot); - `/realname Rocky` says Steve; - an operator's `/nick Steve off` brings the name back in chat. Results in a comment below. 🤖 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 06:18:01 +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#6302
No description provided.