[PR #3865] [MERGED] Disconnect: do not show saving world screen on external server #5259

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3865
Author: @elythepreciouscat
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/server-disconnect-saving-screen


📝 Commits (1)

  • cc4c49e Disconnect: do not show saving world screen on external server

📊 Changes

2 files changed (+23 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+9 -4)
📝 crates/horizon-client/src/game/saving.rs (+14 -2)

📄 Description

🤖 Opened by ElyTheCat's AI agent (Antigravity), not by ElyTheCat directly.

What and why

In vanilla Minecraft 26.3 (Minecraft.disconnect), the saving world screen (GenericMessageScreen(Gui.SAVING_LEVEL)) is only displayed when halting the integrated server (if (singleplayerServer != null)). When disconnecting from a remote external server (isLocalServer() == false), disconnectWithProgressScreen() is used instead and no saving world screen is shown, nor are any world files written to disk.

In Horizon:

  1. begin_closing_save(quit = true) set stage: Stage::Writes when quitting while connected to a remote server or from the title screen, causing render_closing_save to draw "Saving world..." during exit.
  2. close_world() unconditionally called begin_closing_save(false) instead of directly tearing down the remote session via leave_server(None).
  3. save_for_exit() called save_game() on application exit even when remote.is_some().

Fixes:

  • Added Stage::Quit to ClosingSave for clean termination without drawing the save progress screen. When quitting from an external server (self.remote.is_some()), immediately disconnect the session, mark saved_for_exit, and transition directly to Stage::Quit. Quitting from the title screen also uses Stage::Quit.
  • In close_world: if self.external_server() is true, immediately return self.leave_server(None) without entering begin_closing_save.
  • In save_for_exit: cleanly disconnect remote and return without calling save_game() when connected to an external server.

Self-check

pr_ready (tools/pr_ready.py --quick on omarchy, against origin/main at c7065027b, 11 min 32 s)

Check Result
Scope ✅ 2 files, +23 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 423 passed (1 min 4 s)
rustfmt ✅ (12 s)
clippy ✅ (3 min 7 s)
tests: horizon-client ✅ 869 passed (5 min 6 s)
doc tests ✅ 0 passed (2 min 2 s)
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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Google Antigravity


🔄 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/3865 **Author:** [@elythepreciouscat](https://github.com/elythepreciouscat) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/server-disconnect-saving-screen` --- ### 📝 Commits (1) - [`cc4c49e`](https://github.com/horizon-rust/horizon/commit/cc4c49e8f96c94be0e34b07897b4f06fc0fef9d9) Disconnect: do not show saving world screen on external server ### 📊 Changes **2 files changed** (+23 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+9 -4) 📝 `crates/horizon-client/src/game/saving.rs` (+14 -2) </details> ### 📄 Description > 🤖 Opened by ElyTheCat's AI agent (Antigravity), not by ElyTheCat directly. ## What and why In vanilla Minecraft 26.3 (`Minecraft.disconnect`), the saving world screen (`GenericMessageScreen(Gui.SAVING_LEVEL)`) is only displayed when halting the integrated server (`if (singleplayerServer != null)`). When disconnecting from a remote external server (`isLocalServer() == false`), `disconnectWithProgressScreen()` is used instead and no saving world screen is shown, nor are any world files written to disk. In Horizon: 1. `begin_closing_save(quit = true)` set `stage: Stage::Writes` when quitting while connected to a remote server or from the title screen, causing `render_closing_save` to draw `"Saving world..."` during exit. 2. `close_world()` unconditionally called `begin_closing_save(false)` instead of directly tearing down the remote session via `leave_server(None)`. 3. `save_for_exit()` called `save_game()` on application exit even when `remote.is_some()`. Fixes: - Added `Stage::Quit` to `ClosingSave` for clean termination without drawing the save progress screen. When quitting from an external server (`self.remote.is_some()`), immediately disconnect the session, mark `saved_for_exit`, and transition directly to `Stage::Quit`. Quitting from the title screen also uses `Stage::Quit`. - In `close_world`: if `self.external_server()` is true, immediately return `self.leave_server(None)` without entering `begin_closing_save`. - In `save_for_exit`: cleanly disconnect `remote` and return without calling `save_game()` when connected to an external server. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on omarchy, against origin/main at c7065027b, 11 min 32 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +23 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 423 passed (1 min 4 s) | | rustfmt | ✅ (12 s) | | clippy | ✅ (3 min 7 s) | | tests: horizon-client | ✅ 869 passed (5 min 6 s) | | doc tests | ✅ 0 passed (2 min 2 s) | | 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Google Antigravity](https://deepmind.google) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:11:20 +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#5259
No description provided.