[PR #4183] [MERGED] Command blocks: one data path; the command reaches only the player who opens it #5466

Closed
opened 2026-11-03 05:12:47 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4183
Author: @Username59138
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/command-block-one-data-path


📝 Commits (2)

  • dbce642 Command blocks: one data path; the command reaches only the player who opens it
  • 7e6da99 README: the creative toolbar keys are wired

📊 Changes

6 files changed (+15 additions, -41 deletions)

View changed files

📝 README.md (+1 -1)
📝 crates/horizon-client/src/game.rs (+0 -4)
📝 crates/horizon-client/src/game/command_blocks.rs (+11 -22)
📝 crates/horizon-client/src/game/remote.rs (+0 -9)
📝 crates/horizon-client/src/lan/chunks.rs (+0 -3)
📝 docs/rust-parity.md (+3 -2)

📄 Description

🤖 Opened by Username59138's AI agent (Claude Code, Claude Opus 5.5), not by Username59138 personally.

What and why

Fixes #4182. #3582 and #3748 fixed the same bug (#3614) at the same time, so main runs two paths for a command block's data, and #3748's adds one vanilla doesn't have: CommandBlock in lan::chunks::entity_tag. That tag goes into chunk packets and block updates, so every client near a command block, operator or not, receives its command. In 26.3 only the player who opens the block gets it.

  • Server: entity_tag returns nothing for a command block again (vanilla's CommandBlockEntity keeps BlockEntity's empty getUpdateTag), and open_menu no longer marks the block entity updated. The opening player still gets the data from lan_open_command_block (ServerPlayer.openCommandBlock), only in creative with permission level 2.
  • Client: one handler for the packet instead of two. command_block_data_arrived now holds #3748's updateGui port (it refreshes the fields, it doesn't rebuild the screen), and the second check in remote.rs is gone. CommandBlockScreen::pos is private again.
  • docs/rust-parity.md: the toolbar keys and the Saved Hotbars tab have been wired since #3693, so the line saying they are not was dropped.
  • README.md, Known issues: "the creative hotbar keys (C/X) aren't wired to the hotbar loader" was dropped too: they are wired since 85f34393f (game/creative_hotbar.rs).

Refs #3614 (claimed by bunchy7s; fixed on main by #3582 and #3748).

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

From the 26.3 jar (javap): ServerPlayer.openCommandBlock sends ClientboundBlockEntityDataPacket.create(entity, saveCustomOnly) to that player; CommandBlockEntity declares no getUpdateTag or getUpdatePacket; ClientPacketListener.handleBlockEntityData → CommandBlockEditScreen.updateGui.

Checked in the game

--profile fast, server-thread single player on a scratch world: typed a command, closed and reopened the block, the command, its suggestions, the mode and the output settings stay; the block runs it.

Self-check

pr_ready (tools/pr_ready.py --quick on gentoo-pc, against origin/main at 5851a80ce, 2 min 53 s)

Check Result
Scope ✅ 8 files, +27 −40
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (30 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 1 s)
tests: horizon-client ✅ 958 passed (1 min 12 s)
doc tests ✅ 0 passed
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 ➖ 351 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 339 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The scope line counts three untracked game files in my checkout; the commits themselves are 6 files, +14 −41 (the README line came after the self-check).

🤖 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/4183 **Author:** [@Username59138](https://github.com/Username59138) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/command-block-one-data-path` --- ### 📝 Commits (2) - [`dbce642`](https://github.com/horizon-rust/horizon/commit/dbce6420c66602dce13cfaa571648527d8a4e7b0) Command blocks: one data path; the command reaches only the player who opens it - [`7e6da99`](https://github.com/horizon-rust/horizon/commit/7e6da998faa617a2b24a315a2aa1b53280ae58e9) README: the creative toolbar keys are wired ### 📊 Changes **6 files changed** (+15 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) 📝 `crates/horizon-client/src/game.rs` (+0 -4) 📝 `crates/horizon-client/src/game/command_blocks.rs` (+11 -22) 📝 `crates/horizon-client/src/game/remote.rs` (+0 -9) 📝 `crates/horizon-client/src/lan/chunks.rs` (+0 -3) 📝 `docs/rust-parity.md` (+3 -2) </details> ### 📄 Description > 🤖 Opened by Username59138's AI agent (Claude Code, Claude Opus 5.5), not by Username59138 personally. ## What and why Fixes #4182. #3582 and #3748 fixed the same bug (#3614) at the same time, so main runs two paths for a command block's data, and #3748's adds one vanilla doesn't have: `CommandBlock` in `lan::chunks::entity_tag`. That tag goes into chunk packets and block updates, so every client near a command block, operator or not, receives its command. In 26.3 only the player who opens the block gets it. - **Server:** `entity_tag` returns nothing for a command block again (vanilla's `CommandBlockEntity` keeps `BlockEntity`'s empty `getUpdateTag`), and `open_menu` no longer marks the block entity updated. The opening player still gets the data from `lan_open_command_block` (`ServerPlayer.openCommandBlock`), only in creative with permission level 2. - **Client:** one handler for the packet instead of two. `command_block_data_arrived` now holds #3748's `updateGui` port (it refreshes the fields, it doesn't rebuild the screen), and the second check in `remote.rs` is gone. `CommandBlockScreen::pos` is private again. - **docs/rust-parity.md:** the toolbar keys and the Saved Hotbars tab have been wired since #3693, so the line saying they are not was dropped. - **README.md, Known issues:** "the creative hotbar keys (C/X) aren't wired to the hotbar loader" was dropped too: they are wired since 85f34393f (`game/creative_hotbar.rs`). Refs #3614 (claimed by bunchy7s; fixed on main by #3582 and #3748). ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference From the 26.3 jar (`javap`): `ServerPlayer.openCommandBlock` sends `ClientboundBlockEntityDataPacket.create(entity, saveCustomOnly)` to that player; `CommandBlockEntity` declares no `getUpdateTag` or `getUpdatePacket`; `ClientPacketListener.handleBlockEntityData` → `CommandBlockEditScreen.updateGui`. ## Checked in the game `--profile fast`, server-thread single player on a scratch world: typed a command, closed and reopened the block, the command, its suggestions, the mode and the output settings stay; the block runs it. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on gentoo-pc, against origin/main at 5851a80ce, 2 min 53 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +27 −40 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (30 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 1 s) | | tests: horizon-client | ✅ 958 passed (1 min 12 s) | | doc tests | ✅ 0 passed | | 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 | ➖ 351 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 339 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The scope line counts three untracked game files in my checkout; the commits themselves are 6 files, +14 −41 (the README line came after the self-check). 🤖 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 05:12:47 +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#5466
No description provided.