[PR #1465] [MERGED] Signs open their editor on a server's players, and their text reaches the server #3542

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

📋 Pull Request Information

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

Base: main ← Head: fix/st-signs


📝 Commits (3)

  • b8e729b Totems save a server's players: the guest's turn uses it up, and entity event 35 reaches every client
  • de358cd A server's players drop their inventory on death unless keep_inventory is on
  • 52d8ed6 Signs open their editor on a server's players, and what they write reaches the server

📊 Changes

11 files changed (+471 additions, -53 deletions)

View changed files

📝 crates/horizon-client/src/audio.rs (+7 -0)
📝 crates/horizon-client/src/game.rs (+26 -16)
📝 crates/horizon-client/src/game/agent.rs (+6 -0)
📝 crates/horizon-client/src/game/control.rs (+12 -1)
📝 crates/horizon-client/src/game/lan_actions.rs (+27 -1)
📝 crates/horizon-client/src/game/lan_stations.rs (+16 -11)
📝 crates/horizon-client/src/game/remote.rs (+4 -0)
📝 crates/horizon-client/src/game/sign_edit.rs (+86 -4)
📝 crates/horizon-client/src/game/totem.rs (+79 -20)
📝 crates/horizon-protocol/src/packets/play.rs (+63 -0)
📝 tools/lan_e2e.py (+145 -0)

📄 Description

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

Fixes #1380.

What

Placing a sign opens its editor for a server's player, and the text they write reaches the server and every other client. This covers LAN guests and the server-thread host. Before this, no editor opened and the sign stayed blank everywhere.

Why

Horizon had no ClientboundOpenSignEditorPacket and no ServerboundSignUpdatePacket. A guest's turn opened the editor on the host's window state, then dropped it.

How

  • Protocol: OpenSignEditor (Pos, then the side as a VarInt) and SignUpdate (Pos, 4 × stringUtf8(384) with no count, then the side). Both match the vanilla 26.3 StreamCodecs, checked with javap on the client jar, and a round-trip test pins the bytes.
  • Server (ServerPlayer.openTextEdit, SignBlockEntity.updateSignText):
    • a guest's turn that opened the editor sends BlockUpdate, then OpenSignEditor, and remembers the sign (sign_editing);
    • a SignUpdate is accepted only for that sign, only while it is within reach, and only if it isn't waxed;
    • the lines are stored through stripFormatting, and the change then reaches everyone as BlockEntityData.
  • Client:
    • OpenSignEditor opens the editor when that block entity is a sign;
    • closing the editor on a remote client sends SignUpdate; in-frame it marks the block entity updated for the guests.
  • Harness: horizon-ctl type and key now drive the sign editor. The agent's block output shows the sign's front and back lines.

Not in this PR, and missing in both modes before and after: right-clicking an existing sign to edit it again.

Evidence

lan_e2e --check signs has each side place an oak sign and type two lines. It then checks:

  • which window shows the editor;
  • the lines both windows see, read from the agent's block output.
before (both modes) after, in-frame after, --server-thread
host places fails: no sign screen to type into editor on host only; both see host wrote / line two same
guest places fails: no sign screen to type into editor on guest only; both see guest wrote / line two same

Part of the "before" failure comes from the harness: type could not drive the sign screen until this PR. In both modes, the guest's window never opened the editor at all.

How tested

Self-check on the top of the stack (fix/st-books, which contains this PR), Mac mini M4 Pro:

  • cargo fmt --all --check: OK
  • cargo clippy --workspace --all-targets -- -D warnings: OK
  • cargo test -p horizon-protocol: 71 passed. cargo test -p horizon-client --lib: 1061 passed (26 ignored). --bins: 98 + 18 passed.
  • python3 tools/parity.py --changed origin/main: 106 harnesses, 106 passed, 0 failed (23 min).
  • tools/lan_e2e.py, the new checks in both modes (in-frame, then --server-thread), host and guest; the existing sign and lectern checks still pass. Before = origin/main b65e082fd built with the same profile, after = this stack.

Stack

Four small PRs, one fix each, each on top of the previous one (the new lan_e2e checks share one block at the end of the file). Merge in order: #1463 (totem) → #1464 (keep_inventory) → #1465 (signs) → #1466 (books). The change for each PR is its top commit. #1475 (Elytra) and #1476 (shields, tridents, crossbows, spyglasses) continue the stack after #1466.

They leave alone the lines that #1419, #1420 and #1423–#1427 change in tools/lan_e2e.py. The new checks go in a block before if __name__ (CHECKS += [...], CHECK_FNS.update(...)). git merge-tree is clean against each of #1423–#1427. #1419 and #1420 already conflict with main on their own.

Needs Ludovic

A review and a merge, in stack order. Nothing else.

🤖 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/1465 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/st-signs` --- ### 📝 Commits (3) - [`b8e729b`](https://github.com/horizon-rust/horizon/commit/b8e729b950284890ec79d11e4bb448e3a3e4782c) Totems save a server's players: the guest's turn uses it up, and entity event 35 reaches every client - [`de358cd`](https://github.com/horizon-rust/horizon/commit/de358cd72127156cd9c27ecd662ee73b86adb113) A server's players drop their inventory on death unless keep_inventory is on - [`52d8ed6`](https://github.com/horizon-rust/horizon/commit/52d8ed6721be9b7db334284f14b0fb271ba13f86) Signs open their editor on a server's players, and what they write reaches the server ### 📊 Changes **11 files changed** (+471 additions, -53 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/audio.rs` (+7 -0) 📝 `crates/horizon-client/src/game.rs` (+26 -16) 📝 `crates/horizon-client/src/game/agent.rs` (+6 -0) 📝 `crates/horizon-client/src/game/control.rs` (+12 -1) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+27 -1) 📝 `crates/horizon-client/src/game/lan_stations.rs` (+16 -11) 📝 `crates/horizon-client/src/game/remote.rs` (+4 -0) 📝 `crates/horizon-client/src/game/sign_edit.rs` (+86 -4) 📝 `crates/horizon-client/src/game/totem.rs` (+79 -20) 📝 `crates/horizon-protocol/src/packets/play.rs` (+63 -0) 📝 `tools/lan_e2e.py` (+145 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Fixes #1380. ## What Placing a sign opens its editor for a server's player, and the text they write reaches the server and every other client. This covers LAN guests and the server-thread host. Before this, no editor opened and the sign stayed blank everywhere. ## Why Horizon had no `ClientboundOpenSignEditorPacket` and no `ServerboundSignUpdatePacket`. A guest's turn opened the editor on the host's window state, then dropped it. ## How - **Protocol:** `OpenSignEditor` (Pos, then the side as a VarInt) and `SignUpdate` (Pos, 4 × `stringUtf8(384)` with no count, then the side). Both match the vanilla 26.3 `StreamCodec`s, checked with `javap` on the client jar, and a round-trip test pins the bytes. - **Server** (`ServerPlayer.openTextEdit`, `SignBlockEntity.updateSignText`): - a guest's turn that opened the editor sends `BlockUpdate`, then `OpenSignEditor`, and remembers the sign (`sign_editing`); - a `SignUpdate` is accepted only for that sign, only while it is within reach, and only if it isn't waxed; - the lines are stored through `stripFormatting`, and the change then reaches everyone as `BlockEntityData`. - **Client:** - `OpenSignEditor` opens the editor when that block entity is a sign; - closing the editor on a remote client sends `SignUpdate`; in-frame it marks the block entity updated for the guests. - **Harness:** `horizon-ctl type` and `key` now drive the sign editor. The agent's `block` output shows the sign's front and back lines. Not in this PR, and missing in both modes before and after: right-clicking an existing sign to edit it again. ## Evidence `lan_e2e --check signs` has each side place an oak sign and type two lines. It then checks: - which window shows the editor; - the lines both windows see, read from the agent's `block` output. | | before (both modes) | after, in-frame | after, `--server-thread` | |---|---|---|---| | host places | fails: no sign screen to type into | editor on host only; both see `host wrote / line two` | same | | guest places | fails: no sign screen to type into | editor on guest only; both see `guest wrote / line two` | same | Part of the "before" failure comes from the harness: `type` could not drive the sign screen until this PR. In both modes, the guest's window never opened the editor at all. ## How tested Self-check on the top of the stack (fix/st-books, which contains this PR), Mac mini M4 Pro: - `cargo fmt --all --check`: OK - `cargo clippy --workspace --all-targets -- -D warnings`: OK - `cargo test -p horizon-protocol`: 71 passed. `cargo test -p horizon-client --lib`: 1061 passed (26 ignored). `--bins`: 98 + 18 passed. - `python3 tools/parity.py --changed origin/main`: 106 harnesses, 106 passed, 0 failed (23 min). - `tools/lan_e2e.py`, the new checks in both modes (in-frame, then `--server-thread`), host and guest; the existing `sign` and `lectern` checks still pass. Before = origin/main b65e082fd built with the same profile, after = this stack. ## Stack Four small PRs, one fix each, each on top of the previous one (the new lan_e2e checks share one block at the end of the file). Merge in order: #1463 (totem) → #1464 (keep_inventory) → #1465 (signs) → #1466 (books). The change for each PR is its top commit. #1475 (Elytra) and #1476 (shields, tridents, crossbows, spyglasses) continue the stack after #1466. They leave alone the lines that #1419, #1420 and #1423–#1427 change in `tools/lan_e2e.py`. The new checks go in a block before `if __name__` (`CHECKS += [...]`, `CHECK_FNS.update(...)`). `git merge-tree` is clean against each of #1423–#1427. #1419 and #1420 already conflict with main on their own. ## Needs Ludovic A review and a merge, in stack order. Nothing else. 🤖 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:10:17 +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#3542
No description provided.