[PR #5268] [MERGED] Native server helpers: one player's sidebar and Tab list, tick stats, AFK players out of the sleep count #6179

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

📋 Pull Request Information

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

Base: main ← Head: feat/native-sidebar


📝 Commits (4)

  • 79dc296 Native mods: a sidebar and Tab list lines for one player, tick times, AFK players out of the sleep count (API 43)
  • d1207de Merge remote-tracking branch 'origin/main' into feat/native-sidebar
  • 95cdad8 Native sidebar: line holders the sidebar shows (not '#', which vanilla hides)
  • a58349c Merge remote-tracking branch 'origin/main' into feat/native-sidebar

📊 Changes

5 files changed (+142 additions, -8 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+4 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+6 -6)
📝 crates/horizon-client/src/game/native_server.rs (+122 -2)
📝 docs/smp.md (+1 -0)
➕ tools/native-hook-fragments/native-sidebar.json (+9 -0)

📄 Description

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

What

Server helpers a native server mod needs for a public server's screens, for the official server's SMP
(horizon-rust/horizon-mods: the richest players' sidebar, the Tab list, AFK players). Helpers only, no new hook
point: a fragment in tools/native-hook-fragments/native-sidebar.json (the API number comes from
stamp_native_hooks.py after the merge).

  • native_sidebar(uuid, Option<&NativeSidebar>): one player's sidebar, up to 15 lines, each a text and an optional
    text where the score would be (NumberFormat::Fixed), or None to take it away. It is sent to that player's client
    only (an objective of its own, horizon:native_sidebar: remove, add, display slot 1, one score per line), so the
    server's scoreboard never sees it and other players' sidebars are untouched. Line holders are horizon:lineNN:
    vanilla hides holders starting with # from the sidebar.
  • native_tab_list(uuid, header, footer): the lines over and under their Tab list (ClientboundTabListPacket).
  • native_tick_stats(): the tick rate and the average tick time in ms, as /tick query reports them.
  • native_sleep_ignored(uuid, ignored): leaves a player out of the sleep count (players_sleeping_percentage)
    until they are in bed; the SMP uses it for AFK players. sleep_counts skips them unless they sleep.
  • NativeServerPlayer carries yaw and pitch (AFK detection: a player who turns isn't away).

All of them send to the acting player through guest_packets inside a player's hook, and through the hub outside.
Nothing runs per tick: a mod calls them when its lines change.

Proof

  • The SMP mod built on this branch (stamped locally as API 44: feat/native-sidebar-stamped, not for merge) runs
    native.py proof smp on a dedicated server with two real clients: Steve's client holds the sidebar objective with
    the richest players' lines; /sidebar off removes it for Steve only; the Tab list shows the header and footer
    (screenshot in the mods PR); Alex alone in bed passes the night while Steve is AFK (native_sleep_ignored).
  • python3 tools/stamp_native_hooks.py on this branch stamps the fragment as API 44 cleanly.

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 6e2102e2c, 18 min 46 s)

Check Result
Scope ✅ 5 files, +142 −8
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 498 passed (3 min 52 s)
rustfmt ✅ (26 s)
clippy ✅ (24 s)
tests: horizon-client ✅ 1350 passed (12 min 51 s)
doc tests ✅ 0 passed (8 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 ➖ 30 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 18 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/5268 **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-sidebar` --- ### 📝 Commits (4) - [`79dc296`](https://github.com/horizon-rust/horizon/commit/79dc2964db585a097fbb128ca870188ae5ca7b77) Native mods: a sidebar and Tab list lines for one player, tick times, AFK players out of the sleep count (API 43) - [`d1207de`](https://github.com/horizon-rust/horizon/commit/d1207de12bdb364e8b45b19bf7403cbe97d66ef4) Merge remote-tracking branch 'origin/main' into feat/native-sidebar - [`95cdad8`](https://github.com/horizon-rust/horizon/commit/95cdad8b3afec04a356dff9bfbc2e5ae5c4a5ef5) Native sidebar: line holders the sidebar shows (not '#', which vanilla hides) - [`a58349c`](https://github.com/horizon-rust/horizon/commit/a58349cd55897f28e9da473e251ae0e24a1f4954) Merge remote-tracking branch 'origin/main' into feat/native-sidebar ### 📊 Changes **5 files changed** (+142 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+4 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+6 -6) 📝 `crates/horizon-client/src/game/native_server.rs` (+122 -2) 📝 `docs/smp.md` (+1 -0) ➕ `tools/native-hook-fragments/native-sidebar.json` (+9 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Server helpers a native server mod needs for a public server's screens, for the official server's SMP (horizon-rust/horizon-mods: the richest players' sidebar, the Tab list, AFK players). Helpers only, no new hook point: a fragment in `tools/native-hook-fragments/native-sidebar.json` (the API number comes from `stamp_native_hooks.py` after the merge). - `native_sidebar(uuid, Option<&NativeSidebar>)`: one player's sidebar, up to 15 lines, each a text and an optional text where the score would be (`NumberFormat::Fixed`), or `None` to take it away. It is sent to that player's client only (an objective of its own, `horizon:native_sidebar`: remove, add, display slot 1, one score per line), so the server's scoreboard never sees it and other players' sidebars are untouched. Line holders are `horizon:lineNN`: vanilla hides holders starting with `#` from the sidebar. - `native_tab_list(uuid, header, footer)`: the lines over and under their Tab list (`ClientboundTabListPacket`). - `native_tick_stats()`: the tick rate and the average tick time in ms, as `/tick query` reports them. - `native_sleep_ignored(uuid, ignored)`: leaves a player out of the sleep count (`players_sleeping_percentage`) until they are in bed; the SMP uses it for AFK players. `sleep_counts` skips them unless they sleep. - `NativeServerPlayer` carries `yaw` and `pitch` (AFK detection: a player who turns isn't away). All of them send to the acting player through `guest_packets` inside a player's hook, and through the hub outside. Nothing runs per tick: a mod calls them when its lines change. ## Proof - The SMP mod built on this branch (stamped locally as API 44: `feat/native-sidebar-stamped`, not for merge) runs `native.py proof smp` on a dedicated server with two real clients: Steve's client holds the sidebar objective with the richest players' lines; `/sidebar off` removes it for Steve only; the Tab list shows the header and footer (screenshot in the mods PR); Alex alone in bed passes the night while Steve is AFK (`native_sleep_ignored`). - `python3 tools/stamp_native_hooks.py` on this branch stamps the fragment as API 44 cleanly. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 6e2102e2c, 18 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +142 −8 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 498 passed (3 min 52 s) | | rustfmt | ✅ (26 s) | | clippy | ✅ (24 s) | | tests: horizon-client | ✅ 1350 passed (12 min 51 s) | | doc tests | ✅ 0 passed (8 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 | ➖ 30 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, locator_bar and 18 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:15:35 +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#6179
No description provided.