[PR #2498] [MERGED] Open the command block screen on a server's client and send its edits #4368

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2498
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/2494-command-block-use


📝 Commits (1)

  • 6977659 Open the command block screen on a server's client and send its edits

📊 Changes

5 files changed (+106 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/command_block.rs (+17 -0)
📝 crates/horizon-client/src/game/command_blocks.rs (+80 -3)
📝 crates/horizon-client/src/game/lan_actions.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+1 -0)
📝 crates/horizon-protocol/src/packets/play.rs (+7 -0)

📄 Description

What and why

Right-clicking a command block in a single player world did nothing but swing the hand. The edit screen only existed for the window's own world: a server's client (which is what single player is) never opened it, and the screen's Done button had no packet to send, so nothing could be saved.

Now the client opens the command block screen on a right click when the player is in creative with game master permission (vanilla opens it on the client in CommandBlock.useWithoutItem). Done sends ServerboundSetCommandBlockPacket, and the server applies it the same way it already did for the host: mode, conditional, automatic, command and track output, with the "not allowed" message when the player may not edit command blocks.

Fixes #2494.

Vanilla reference

  • CommandBlock.useWithoutItem, Player.openCommandBlock
  • ServerboundSetCommandBlockPacket (position, command, mode, flags 1/2/4)
  • ServerGamePacketListenerImpl.handleSetCommandBlock

Self-check

cargo check -p horizon-client passes.


🔄 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/2498 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2494-command-block-use` --- ### 📝 Commits (1) - [`6977659`](https://github.com/horizon-rust/horizon/commit/6977659843800ded64f86b48ad744b9e0c940eb8) Open the command block screen on a server's client and send its edits ### 📊 Changes **5 files changed** (+106 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/command_block.rs` (+17 -0) 📝 `crates/horizon-client/src/game/command_blocks.rs` (+80 -3) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -0) 📝 `crates/horizon-protocol/src/packets/play.rs` (+7 -0) </details> ### 📄 Description ## What and why Right-clicking a command block in a single player world did nothing but swing the hand. The edit screen only existed for the window's own world: a server's client (which is what single player is) never opened it, and the screen's Done button had no packet to send, so nothing could be saved. Now the client opens the command block screen on a right click when the player is in creative with game master permission (vanilla opens it on the client in `CommandBlock.useWithoutItem`). Done sends `ServerboundSetCommandBlockPacket`, and the server applies it the same way it already did for the host: mode, conditional, automatic, command and track output, with the "not allowed" message when the player may not edit command blocks. Fixes #2494. ## Vanilla reference - `CommandBlock.useWithoutItem`, `Player.openCommandBlock` - `ServerboundSetCommandBlockPacket` (position, command, mode, flags 1/2/4) - `ServerGamePacketListenerImpl.handleSetCommandBlock` ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:39 +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#4368
No description provided.