[PR #3349] [MERGED] World list: show Hardcore Mode in red, and adventure and spectator by name (#3298) #4919

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

📋 Pull Request Information

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

Base: main ← Head: fix/world-list-hardcore


📝 Commits (2)

  • 2acf1d7 World list: show Hardcore Mode in red, and adventure and spectator by name
  • 5667e9e Merge main into the branch

📊 Changes

4 files changed (+82 additions, -21 deletions)

View changed files

📝 crates/horizon-client/src/game/agent.rs (+4 -2)
📝 crates/horizon-client/src/game/saves_control.rs (+1 -1)
📝 crates/horizon-client/src/title.rs (+32 -18)
📝 crates/horizon-client/src/title/tests.rs (+45 -0)

📄 Description

🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally.

Fixes #3298.

What

In Select World, a hardcore world reads "Survival Mode" in gray instead of vanilla's red "Hardcore Mode". Adventure and spectator worlds also read "Survival Mode", because the info line was built from a single creative flag.

Vanilla

LevelSummary.createInfo (via tools/rea_vanilla.py method net.minecraft.world.level.storage.LevelSummary createInfo):

  • hardcore: the gameMode.hardcore translation coloured with CommonColors.RED, which is -65536 (javap -constants on the pinned client.jar), so 0xFF0000;
  • otherwise: "gameMode." + getGameMode().getName(), which gives survival, creative, adventure or spectator;
  • then , Commands and , Version: … in the row's default gray.

How

  • WorldEntry carries game_mode and hardcore in place of creative. Level::read already read both from level.dat (GameType and difficulty_settings.hardcore, the same place save.rs writes them).
  • A new world_info builds the line as styled Text, with the mode span red only when hardcore. The row draws it with text_styled.
  • The horizon-ctl JSON (agent.rs worlds list, saves_control.rs) keeps its creative / mode values exactly as before (game_mode == 1), so scripts don't change.
  • The new test title::tests::world_list_names_every_game_mode_and_hardcore_in_red goes from level.dat through list_worlds to world_info.

Verified

  • In the game, in a scratch HORIZON_HOME: I created a world with Game Mode: Hardcore through Create New World, chose Save and Quit to Title, then opened Singleplayer.
    • v0.2.91 (unfixed): "Survival Mode, Version: 26.3", all gray. This reproduces #3298.
    • this branch: "Hardcore Mode" in red, then ", Version: 26.3" in gray.
  • Hand-written level.dats with GameType 2 and 3 show "Adventure Mode" and "Spectator Mode". Creative with commands still shows "Creative Mode, Commands, Version: 26.3".
  • pr_ready --quick is below. parity.py --changed selects 355 harnesses for a horizon-client change, so I left parity to CI.

pr_ready (tools/pr_ready.py --quick on b550, against origin/main at e0bf5f659, 3 min 39 s)

Check Result
Scope ✅ 4 files, +82 −21
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 402 passed (29 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 22 s)
tests: horizon-client ✅ 1281 passed (1 min 20 s)
doc tests ✅ 0 passed (22 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 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/3349 **Author:** [@degepie](https://github.com/degepie) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/world-list-hardcore` --- ### 📝 Commits (2) - [`2acf1d7`](https://github.com/horizon-rust/horizon/commit/2acf1d779845d162710eaf1ea521d3b64a04302f) World list: show Hardcore Mode in red, and adventure and spectator by name - [`5667e9e`](https://github.com/horizon-rust/horizon/commit/5667e9ebd19812046fa7c586648c72835fca33de) Merge main into the branch ### 📊 Changes **4 files changed** (+82 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/agent.rs` (+4 -2) 📝 `crates/horizon-client/src/game/saves_control.rs` (+1 -1) 📝 `crates/horizon-client/src/title.rs` (+32 -18) 📝 `crates/horizon-client/src/title/tests.rs` (+45 -0) </details> ### 📄 Description > 🤖 Opened by degepie's AI agent (Claude Code), not by degepie personally. Fixes #3298. ## What In Select World, a hardcore world reads "Survival Mode" in gray instead of vanilla's red "Hardcore Mode". Adventure and spectator worlds also read "Survival Mode", because the info line was built from a single `creative` flag. ## Vanilla `LevelSummary.createInfo` (via `tools/rea_vanilla.py method net.minecraft.world.level.storage.LevelSummary createInfo`): - hardcore: the `gameMode.hardcore` translation coloured with `CommonColors.RED`, which is -65536 (`javap -constants` on the pinned client.jar), so 0xFF0000; - otherwise: `"gameMode." + getGameMode().getName()`, which gives survival, creative, adventure or spectator; - then `, Commands` and `, Version: …` in the row's default gray. ## How - `WorldEntry` carries `game_mode` and `hardcore` in place of `creative`. `Level::read` already read both from `level.dat` (`GameType` and `difficulty_settings.hardcore`, the same place `save.rs` writes them). - A new `world_info` builds the line as styled `Text`, with the mode span red only when hardcore. The row draws it with `text_styled`. - The `horizon-ctl` JSON (`agent.rs` worlds list, `saves_control.rs`) keeps its `creative` / `mode` values exactly as before (`game_mode == 1`), so scripts don't change. - The new test `title::tests::world_list_names_every_game_mode_and_hardcore_in_red` goes from `level.dat` through `list_worlds` to `world_info`. ## Verified - In the game, in a scratch `HORIZON_HOME`: I created a world with Game Mode: Hardcore through Create New World, chose Save and Quit to Title, then opened Singleplayer. - v0.2.91 (unfixed): "Survival Mode, Version: 26.3", all gray. This reproduces #3298. - this branch: "**Hardcore Mode**" in red, then ", Version: 26.3" in gray. - Hand-written `level.dat`s with GameType 2 and 3 show "Adventure Mode" and "Spectator Mode". Creative with commands still shows "Creative Mode, Commands, Version: 26.3". - `pr_ready --quick` is below. `parity.py --changed` selects 355 harnesses for a `horizon-client` change, so I left parity to CI. **pr_ready** (`tools/pr_ready.py --quick` on b550, against origin/main at e0bf5f659, 3 min 39 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +82 −21 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 402 passed (29 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 22 s) | | tests: horizon-client | ✅ 1281 passed (1 min 20 s) | | doc tests | ✅ 0 passed (22 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 [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:08:55 +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#4919
No description provided.