[PR #6097] [MERGED] Command blocks tell the operators what they did, and Done confirms to the editor #6652

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6097
Author: @Akirabane
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/6066-6067-command-block-feedback


📝 Commits (2)

  • fdd8066 Command blocks: the output reaches the operators, the editor's confirmation reaches the editor
  • cb24175 Merge remote-tracking branch 'origin/main' into fix/6066-6067-command-block-feedback

📊 Changes

5 files changed (+57 additions, -33 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -3)
📝 crates/horizon-client/src/game/command_blocks.rs (+7 -9)
📝 crates/horizon-client/src/game/command_minecarts.rs (+5 -11)
📝 crates/horizon-client/src/game/commands.rs (+35 -5)
📝 crates/horizon-client/src/game/lan_actions.rs (+6 -5)

📄 Description

🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review.

What and why

Fixes #6066
Fixes #6067

  • #6067. A command block's or command minecart's chat.type.admin line was added to the server game's own chat, so no operator ever saw it. It now goes through the broadcastToAdmins queue (send_admin_feedback): every operator gets it when send_command_feedback is on, the world's host too (no player ran the command), and a dedicated server's console logs it when log_admin_commands is on. command_block_output, send_command_feedback, output tracking and the quiet messages are kept.
  • A command that sends its success unbroadcast (sendSuccess(.., false)) used to be broadcast from a command block as well; it no longer reaches the operators.
  • #6066. The confirmation after Done on a command block or a command minecart (advMode.setCommand.success, .disabled, .notAllowed) went through as_guest, which dropped it. It now goes through as_guest_messaged, so only the editing player receives it.

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

CommandSourceStack.sendSuccess / broadcastToAdmins, BaseCommandBlock.createSource, ServerGamePacketListenerImpl.handleSetCommandBlock / handleSetCommandMinecart, as named in #6066 and #6067. The harness tools/test_server_ops_feedback_parity.py (operator feedback of a dedicated server against a vanilla one) passes on this branch: 17 chat lines identical.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick, against origin/main at 07c41af9d)

Check Result
Scope ✅ 5 files, +57 −33
Public tree ✅
rustfmt ✅
clippy ✅
tests: horizon-client ✅ 1770 passed
Python tests ❌ test_port_ledger fails to import (No module named 'tests.test_class_index'): a package named tests on my Windows machine shadows the repo's; no Python file is touched here
Parity ➖ not run (--quick): CI's parity job picks the harnesses

Proof

Single player (the owner is a guest of the integrated server) and a LAN with a second client, driven with horizon-ctl (launch, command, interact, events), before and after this change:

Case Before After
Impulse command block time set 8000, powered, the owner SuccessCount: 1, nothing in chat [@: Set minecraft:overworld to 8000 tick(s)]
Same, a guest with commands allowed nothing the same line
Same, publish false (a guest without commands) nothing nothing for the guest, the line for the host
Done on a command block, the owner nothing Command set: time set 4000 x x
Done on a command block, an operator guest nothing Command set: time set 100 guest for the guest only; the host sees nothing

Command minecart (headless, same setup): a powered activator rail running time set 200 puts [@: Set minecraft:overworld to 200 tick(s)] in the chat, and Done on its edit screen answers Command set: time set 200 cart.

There is no unit test: Game has no test harness for this path, so the checks above are live ones.


🔄 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/6097 **Author:** [@Akirabane](https://github.com/Akirabane) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6066-6067-command-block-feedback` --- ### 📝 Commits (2) - [`fdd8066`](https://github.com/horizon-rust/horizon/commit/fdd8066b7772bf6c0120c6fa10e46fb2c5a98bdd) Command blocks: the output reaches the operators, the editor's confirmation reaches the editor - [`cb24175`](https://github.com/horizon-rust/horizon/commit/cb24175ff3bdd7e80623321c155d349e9bdea438) Merge remote-tracking branch 'origin/main' into fix/6066-6067-command-block-feedback ### 📊 Changes **5 files changed** (+57 additions, -33 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -3) 📝 `crates/horizon-client/src/game/command_blocks.rs` (+7 -9) 📝 `crates/horizon-client/src/game/command_minecarts.rs` (+5 -11) 📝 `crates/horizon-client/src/game/commands.rs` (+35 -5) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+6 -5) </details> ### 📄 Description 🤖 Opened by both Akirabane's AI agent (Claude Code), and Akirabane Himself after his review. ## What and why Fixes #6066 Fixes #6067 - **#6067.** A command block's or command minecart's `chat.type.admin` line was added to the server game's own chat, so no operator ever saw it. It now goes through the `broadcastToAdmins` queue (`send_admin_feedback`): every operator gets it when `send_command_feedback` is on, the world's host too (no player ran the command), and a dedicated server's console logs it when `log_admin_commands` is on. `command_block_output`, `send_command_feedback`, output tracking and the quiet messages are kept. - A command that sends its success unbroadcast (`sendSuccess(.., false)`) used to be broadcast from a command block as well; it no longer reaches the operators. - **#6066.** The confirmation after Done on a command block or a command minecart (`advMode.setCommand.success`, `.disabled`, `.notAllowed`) went through `as_guest`, which dropped it. It now goes through `as_guest_messaged`, so only the editing player receives it. ## 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 `CommandSourceStack.sendSuccess` / `broadcastToAdmins`, `BaseCommandBlock.createSource`, `ServerGamePacketListenerImpl.handleSetCommandBlock` / `handleSetCommandMinecart`, as named in #6066 and #6067. The harness `tools/test_server_ops_feedback_parity.py` (operator feedback of a dedicated server against a vanilla one) passes on this branch: 17 chat lines identical. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick`, against origin/main at 07c41af9d) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +57 −33 | | Public tree | ✅ | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client | ✅ 1770 passed | | Python tests | ❌ `test_port_ledger` fails to import (`No module named 'tests.test_class_index'`): a package named `tests` on my Windows machine shadows the repo's; no Python file is touched here | | Parity | ➖ not run (`--quick`): CI's parity job picks the harnesses | ## Proof Single player (the owner is a guest of the integrated server) and a LAN with a second client, driven with `horizon-ctl` (`launch`, `command`, `interact`, `events`), before and after this change: | Case | Before | After | | --- | --- | --- | | Impulse command block `time set 8000`, powered, the owner | `SuccessCount: 1`, nothing in chat | `[@: Set minecraft:overworld to 8000 tick(s)]` | | Same, a guest with commands allowed | nothing | the same line | | Same, `publish false` (a guest without commands) | nothing | nothing for the guest, the line for the host | | Done on a command block, the owner | nothing | `Command set: time set 4000 x x` | | Done on a command block, an operator guest | nothing | `Command set: time set 100 guest` for the guest only; the host sees nothing | Command minecart (headless, same setup): a powered activator rail running `time set 200` puts `[@: Set minecraft:overworld to 200 tick(s)]` in the chat, and Done on its edit screen answers `Command set: time set 200 cart`. There is no unit test: `Game` has no test harness for this path, so the checks above are live ones. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:24:25 +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#6652
No description provided.