[PR #669] [CLOSED] World options: the game rules page edits the server thread's rules #2715

Closed
opened 2026-11-02 15:58:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/669
Author: @ludovic111
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: fix/server-game-rules-page


📝 Commits (1)

  • 2307872 World options: the game rules page edits the server thread's rules

📊 Changes

1 file changed (+31 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_screen.rs (+31 -2)

📄 Description

Part of moving single player onto the server thread (brief item 6, second half). Independent of #655, #662, #664 and #668. Based on main.

What was wrong

With --server-thread, the world's game rules live on the server thread. The World Options game rules page still worked on the window's own copy:

  • It showed the window's rules, not the world's.
  • Done changed rules nothing in the world reads.
  • Done was refused anyway: the Allow Commands check read the window's level, which is empty, so it always returned "no".

The fix

  • Opening the page asks the server for its rules with Integrated::call.
  • Done sets the changed rules on the server, behind the server's own Allow Commands, then runs sync_rules there. This is the same path as /gamerule, and how vanilla's ServerboundSetGameRulePacket reaches handleSetGameRule.
  • The window keeps its copy in step and prints the same "Game rule … is now set to …" lines.
  • The in-frame path (no server thread) is unchanged.

Checks

  • cargo fmt --all --check and cargo clippy --workspace --all-targets -- -D warnings: clean.
  • cargo test -p horizon-client --lib: 792 passed.
  • Smoke test with --server-thread, through Pause → World Options… → Edit Game Rules…: switching off the first rule and pressing Done prints "Game rule command_block_output is now set to false". Afterwards, /gamerule command_block_output, which the server answers, prints "is currently set to false".

Label: skip-release; the flip PR carries the release note.

🤖 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/669 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/server-game-rules-page` --- ### 📝 Commits (1) - [`2307872`](https://github.com/horizon-rust/horizon/commit/2307872298843b575346b9e07179d0fe2c77031d) World options: the game rules page edits the server thread's rules ### 📊 Changes **1 file changed** (+31 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_screen.rs` (+31 -2) </details> ### 📄 Description Part of moving single player onto the server thread (brief item 6, second half). Independent of #655, #662, #664 and #668. Based on main. ## What was wrong With `--server-thread`, the world's game rules live on the server thread. The World Options game rules page still worked on the window's own copy: - It showed the window's rules, not the world's. - Done changed rules nothing in the world reads. - Done was refused anyway: the Allow Commands check read the window's level, which is empty, so it always returned "no". ## The fix - Opening the page asks the server for its rules with `Integrated::call`. - Done sets the changed rules on the server, behind the server's own Allow Commands, then runs `sync_rules` there. This is the same path as `/gamerule`, and how vanilla's `ServerboundSetGameRulePacket` reaches `handleSetGameRule`. - The window keeps its copy in step and prints the same "Game rule … is now set to …" lines. - The in-frame path (no server thread) is unchanged. ## Checks - `cargo fmt --all --check` and `cargo clippy --workspace --all-targets -- -D warnings`: clean. - `cargo test -p horizon-client --lib`: 792 passed. - Smoke test with `--server-thread`, through Pause → World Options… → Edit Game Rules…: switching off the first rule and pressing Done prints "Game rule command_block_output is now set to false". Afterwards, `/gamerule command_block_output`, which the server answers, prints "is currently set to false". Label: `skip-release`; the flip PR carries the release note. 🤖 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-02 15:58:29 +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#2715
No description provided.