[PR #4732] [MERGED] World open: backup question for customized/experimental worlds, low disk space, unreadable level data #5813

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

📋 Pull Request Information

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

Base: main ← Head: parity/17-open


📝 Commits (1)

  • 1f4dba5 WorldOpenFlows: backup question for customized and experimental worlds, low disk space, unreadable level data

📊 Changes

7 files changed (+612 additions, -14 deletions)

View changed files

📝 crates/horizon-client/Cargo.toml (+2 -1)
📝 crates/horizon-client/src/game.rs (+8 -0)
📝 crates/horizon-client/src/game/agent.rs (+3 -0)
📝 crates/horizon-client/src/game/world_loading.rs (+14 -0)
📝 crates/horizon-client/src/save.rs (+246 -0)
📝 crates/horizon-client/src/title.rs (+165 -13)
📝 crates/horizon-client/src/title/tests.rs (+174 -0)

📄 Description

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

Part of #3518

What and why

Opening a world from the list asks the questions WorldOpenFlows asks. Rows done:

  • WorldOpenFlows.askForBackup: the BackupConfirmScreen over a customized or experimental world (selectWorld.backupQuestion/backupWarning.customized|experimental), with Create Backup and Load / I Know What I'm Doing! / Cancel; the backup then opens the world without asking again (the existing backup_then_open path).
  • WorldOpenFlows.openWorldCheckWorldStemCompatibility (partial): WorldOptions.isOldCustomizedWorld (legacy_custom_options in the generator settings) and worldGenSettingsLifecycle != stable as WorldDimensions.bake computes it from the saved dimensions (isStableOverworld/Nether/End, a missing builtin dimension, any other dimension). Not read: dimensions that data packs add, and worlds that still need file fixes are asked only on a later open (their generator settings are in the old layout until the fixes run while opening).
  • WorldOpenFlows.openWorldCheckDiskSpace: LevelStorageAccess.checkForLowDiskSpace (estimateDiskSpace < 64 MiB; statvfs on Unix, GetDiskFreeSpaceExW on Windows) opens the "Warning! Low disk space!" ConfirmScreen (Continue / Back) before the load.
  • WorldOpenFlows.openWorldLoadLevelData: a world opened by name without the list (control socket open) whose level data does not read shows RecoverWorldDataScreen (the list's path already did); WorldRequest::prepare no longer opens such a world as a new random-seed one under the same name (it fails with a message), so a crash-truncated level.dat cannot be overwritten.

Already on main, no change (see result notes): createBackupAndOpenWorld (Create Backup and Load in BackupConfirmScreen, then open), loadBundledResourcePack and openWorldLoadBundledResourcePack (game/server_packs.rs server_packs_world_pack, called from integrated.rs before the world connects; resourcepacks/resources.zip is LevelResource.MAP_RESOURCE_FILE).

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

WorldOpenFlows.{openWorldLoadLevelData,openWorldCheckWorldStemCompatibility,askForBackup,openWorldCheckDiskSpace,openWorldDoLoad}, WorldOptions.isOldCustomizedWorld, WorldDimensions.{bake,isVanillaLike,isStableOverworld,isStableNether,isStableEnd}, LevelStorageSource.LevelStorageAccess.{estimateDiskSpace,checkForLowDiskSpace}, BackupConfirmScreen, ConfirmScreen.

Self-check

fmt --all, clippy -p horizon-client --all-targets -D warnings, test -p horizon-client --lib --bins (857 + bins passed), new tests in title/tests.rs (customized, experimental then backup then open, low disk space, recovery by name) and save.rs (stem stability per preset and edits, disk space). No harness or game run (machine limits); CI verify is the full 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/4732 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/17-open` --- ### 📝 Commits (1) - [`1f4dba5`](https://github.com/horizon-rust/horizon/commit/1f4dba50e30052e899be025f1324cc65d2b34fd8) WorldOpenFlows: backup question for customized and experimental worlds, low disk space, unreadable level data ### 📊 Changes **7 files changed** (+612 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/Cargo.toml` (+2 -1) 📝 `crates/horizon-client/src/game.rs` (+8 -0) 📝 `crates/horizon-client/src/game/agent.rs` (+3 -0) 📝 `crates/horizon-client/src/game/world_loading.rs` (+14 -0) 📝 `crates/horizon-client/src/save.rs` (+246 -0) 📝 `crates/horizon-client/src/title.rs` (+165 -13) 📝 `crates/horizon-client/src/title/tests.rs` (+174 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3518 ## What and why Opening a world from the list asks the questions `WorldOpenFlows` asks. Rows done: - `WorldOpenFlows.askForBackup`: the `BackupConfirmScreen` over a customized or experimental world (`selectWorld.backupQuestion/backupWarning.customized|experimental`), with Create Backup and Load / I Know What I'm Doing! / Cancel; the backup then opens the world without asking again (the existing `backup_then_open` path). - `WorldOpenFlows.openWorldCheckWorldStemCompatibility` (partial): `WorldOptions.isOldCustomizedWorld` (`legacy_custom_options` in the generator settings) and `worldGenSettingsLifecycle != stable` as `WorldDimensions.bake` computes it from the saved dimensions (`isStableOverworld/Nether/End`, a missing builtin dimension, any other dimension). Not read: dimensions that data packs add, and worlds that still need file fixes are asked only on a later open (their generator settings are in the old layout until the fixes run while opening). - `WorldOpenFlows.openWorldCheckDiskSpace`: `LevelStorageAccess.checkForLowDiskSpace` (`estimateDiskSpace` < 64 MiB; statvfs on Unix, `GetDiskFreeSpaceExW` on Windows) opens the "Warning! Low disk space!" ConfirmScreen (Continue / Back) before the load. - `WorldOpenFlows.openWorldLoadLevelData`: a world opened by name without the list (control socket `open`) whose level data does not read shows `RecoverWorldDataScreen` (the list's path already did); `WorldRequest::prepare` no longer opens such a world as a new random-seed one under the same name (it fails with a message), so a crash-truncated level.dat cannot be overwritten. Already on main, no change (see result notes): `createBackupAndOpenWorld` (Create Backup and Load in `BackupConfirmScreen`, then open), `loadBundledResourcePack` and `openWorldLoadBundledResourcePack` (`game/server_packs.rs` `server_packs_world_pack`, called from `integrated.rs` before the world connects; `resourcepacks/resources.zip` is `LevelResource.MAP_RESOURCE_FILE`). ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `WorldOpenFlows.{openWorldLoadLevelData,openWorldCheckWorldStemCompatibility,askForBackup,openWorldCheckDiskSpace,openWorldDoLoad}`, `WorldOptions.isOldCustomizedWorld`, `WorldDimensions.{bake,isVanillaLike,isStableOverworld,isStableNether,isStableEnd}`, `LevelStorageSource.LevelStorageAccess.{estimateDiskSpace,checkForLowDiskSpace}`, `BackupConfirmScreen`, `ConfirmScreen`. ## Self-check `fmt --all`, `clippy -p horizon-client --all-targets -D warnings`, `test -p horizon-client --lib --bins` (857 + bins passed), new tests in `title/tests.rs` (customized, experimental then backup then open, low disk space, recovery by name) and `save.rs` (stem stability per preset and edits, disk space). No harness or game run (machine limits); CI `verify` is the full 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:15:10 +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#5813
No description provided.