[PR #3693] [MERGED] Creative inventory: the Saved Hotbars tab, as vanilla shows it #5154

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

📋 Pull Request Information

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

Base: main ← Head: feat/creative-saved-hotbars


📝 Commits (3)

  • fa77b35 Creative inventory: the Saved Hotbars tab, as vanilla shows it
  • e8d5059 Merge remote-tracking branch 'origin/main' into upd-3693
  • 31ad980 Merge main: main's new tab test builds a Tab with hotbar false

📊 Changes

6 files changed (+154 additions, -11 deletions)

View changed files

📝 crates/horizon-client/src/creative.rs (+85 -1)
📝 crates/horizon-client/src/game.rs (+11 -6)
📝 crates/horizon-client/src/game/creative_hotbar.rs (+54 -1)
📝 crates/horizon-client/src/game/remote.rs (+1 -0)
📝 crates/horizon-client/src/game/ui_control.rs (+2 -2)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaCreativeSearchOracle.java (+1 -1)

📄 Description

🤖 Opened by Username59138's AI agent (Claude), not by Username59138 themselves.

What and why

The creative inventory had no Saved Hotbars tab. It has been skipped since the creative tabs came in (#49: "Not covered: the operator tab … and the saved-hotbars tab"), while saving and loading toolbars with C or X and a hotbar key already worked (game/creative_hotbar.rs). Nothing showed the gap: the creative harness's oracle left the tab out too (below). No open pull request or issue covers it.

  • The tab (CreativeModeInventoryScreen.selectTab, HOTBAR branch): the nine saved rows of hotbar.nbt. An empty row shows a paper in its own slot with creative_slot_lock and the item name inventory.hotbarInfo ("Save hotbar with C + 1"), from the bound save and hotbar keys. The rows are read when the tab is selected and when the inventory opens on it, as selectTab runs then.
  • The hint can't be taken (CustomCreativeSlot.mayPickup): click_display does nothing on a creative_slot_lock stack, and a carried stack stays as it is.
  • Empty slots inside a row: Creative::shown gives a grid cell's stack, None for a saved row's empty slot, for the clicks, the hover, the drawing and horizon-ctl ui.

The harness

VanillaCreativeSearchOracle marked tabs as shown with getType() != HOTBAR && shouldDisplay(), so test_creative_parity.py compared the tabs without the one Horizon didn't show. It now uses shouldDisplay() alone, which is what vanilla shows: with this change the HOTBAR tab is in Horizon's list, and every later tab would otherwise be compared one place off. The tab's display items are empty on both sides (vanilla fills the screen from HotbarManager in selectTab, not from getDisplayItems). Run locally: creative 13 tabs (with minecraft:hotbar) and 6793/6793 searches match; creative_mining and chat_screen pass.

Vanilla reference

From the 26.3 jar (javap -c): CreativeModeInventoryScreen.selectTab (the HOTBAR branch: HotbarManager.get, Hotbar.isEmpty, Items.PAPER with CREATIVE_SLOT_LOCK and ITEM_NAME = inventory.hotbarInfo with keySaveHotbarActivator then keyHotbarSlots[i], Hotbar.load), CustomCreativeSlot.mayPickup, slotClicked's mayPickup return; the exported tab (minecraft:hotbar, TOP, column 5, bookshelf icon).

Checked in the game

Release build, server-thread single player, horizon-ctl on a scratch world: the bookshelf tab sits in the top row at column 5; with no saved rows, the papers run down the diagonal and the first one's tooltip reads "Save hotbar with C + 1"; clicking it takes nothing; after give a sword, 64 stone and 32 torches and C+1, the tab's first row shows them and the other rows keep their hints. New unit test: creative::tests::saved_hotbars_tab_shows_its_rows_and_locks_the_hint.

Self-check

pr_ready (tools/pr_ready.py --quick on gentoo-pc, against origin/main at 87a6a7a16, 3 min 36 s)

Check Result
Scope ✅ 7 files, +166 −11
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 411 passed (30 s)
rustfmt ✅ (6 s)
clippy ✅ (58 s)
tests: horizon-client ✅ 814 passed (1 min 41 s)
doc tests ✅ 0 passed (13 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 ➖ 349 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 337 more
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/3693 **Author:** [@Username59138](https://github.com/Username59138) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `feat/creative-saved-hotbars` --- ### 📝 Commits (3) - [`fa77b35`](https://github.com/horizon-rust/horizon/commit/fa77b351405efd60e27620bf71901727e9b6a951) Creative inventory: the Saved Hotbars tab, as vanilla shows it - [`e8d5059`](https://github.com/horizon-rust/horizon/commit/e8d5059b6a5a374317b0fbfeaf28329853fdc516) Merge remote-tracking branch 'origin/main' into upd-3693 - [`31ad980`](https://github.com/horizon-rust/horizon/commit/31ad980443c74da78ac08a46a3c2731b41b22f3e) Merge main: main's new tab test builds a Tab with hotbar false ### 📊 Changes **6 files changed** (+154 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/creative.rs` (+85 -1) 📝 `crates/horizon-client/src/game.rs` (+11 -6) 📝 `crates/horizon-client/src/game/creative_hotbar.rs` (+54 -1) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -0) 📝 `crates/horizon-client/src/game/ui_control.rs` (+2 -2) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaCreativeSearchOracle.java` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Username59138's AI agent (Claude), not by Username59138 themselves. ## What and why The creative inventory had no **Saved Hotbars** tab. It has been skipped since the creative tabs came in (#49: "Not covered: the operator tab … and the saved-hotbars tab"), while saving and loading toolbars with C or X and a hotbar key already worked (`game/creative_hotbar.rs`). Nothing showed the gap: the creative harness's oracle left the tab out too (below). No open pull request or issue covers it. - **The tab** (`CreativeModeInventoryScreen.selectTab`, HOTBAR branch): the nine saved rows of `hotbar.nbt`. An empty row shows a paper in its own slot with `creative_slot_lock` and the item name `inventory.hotbarInfo` ("Save hotbar with C + 1"), from the bound save and hotbar keys. The rows are read when the tab is selected and when the inventory opens on it, as `selectTab` runs then. - **The hint can't be taken** (`CustomCreativeSlot.mayPickup`): `click_display` does nothing on a `creative_slot_lock` stack, and a carried stack stays as it is. - **Empty slots inside a row**: `Creative::shown` gives a grid cell's stack, None for a saved row's empty slot, for the clicks, the hover, the drawing and `horizon-ctl ui`. ## The harness `VanillaCreativeSearchOracle` marked tabs as shown with `getType() != HOTBAR && shouldDisplay()`, so `test_creative_parity.py` compared the tabs without the one Horizon didn't show. It now uses `shouldDisplay()` alone, which is what vanilla shows: with this change the HOTBAR tab is in Horizon's list, and every later tab would otherwise be compared one place off. The tab's display items are empty on both sides (vanilla fills the screen from `HotbarManager` in `selectTab`, not from `getDisplayItems`). Run locally: `creative` 13 tabs (with `minecraft:hotbar`) and 6793/6793 searches match; `creative_mining` and `chat_screen` pass. ## Vanilla reference From the 26.3 jar (`javap -c`): `CreativeModeInventoryScreen.selectTab` (the HOTBAR branch: `HotbarManager.get`, `Hotbar.isEmpty`, `Items.PAPER` with `CREATIVE_SLOT_LOCK` and `ITEM_NAME` = `inventory.hotbarInfo` with `keySaveHotbarActivator` then `keyHotbarSlots[i]`, `Hotbar.load`), `CustomCreativeSlot.mayPickup`, `slotClicked`'s `mayPickup` return; the exported tab (`minecraft:hotbar`, TOP, column 5, bookshelf icon). ## Checked in the game Release build, server-thread single player, `horizon-ctl` on a scratch world: the bookshelf tab sits in the top row at column 5; with no saved rows, the papers run down the diagonal and the first one's tooltip reads "Save hotbar with C + 1"; clicking it takes nothing; after `give` a sword, 64 stone and 32 torches and C+1, the tab's first row shows them and the other rows keep their hints. New unit test: `creative::tests::saved_hotbars_tab_shows_its_rows_and_locks_the_hint`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on gentoo-pc, against origin/main at 87a6a7a16, 3 min 36 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +166 −11 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 411 passed (30 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (58 s) | | tests: horizon-client | ✅ 814 passed (1 min 41 s) | | doc tests | ✅ 0 passed (13 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 | ➖ 349 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 337 more | | 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:10:36 +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#5154
No description provided.