[PR #5066] [MERGED] Content mods: creative inventory tabs, paged as NeoForge pages them #6037

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5066
Author: @Sylviromi
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: content-creative-tabs


📝 Commits (6)

  • 74ff545 Content mods: creative inventory tabs, paged as NeoForge pages them
  • a138c13 Creative tabs: block items once in search, nine-sliced page buttons, lang titles
  • 9be1573 Fix creative page releases and vanilla tab items
  • 4c41466 Creative tabs: the title may be a lang key
  • ae1eb14 Creative tabs: look the title up as a lang key (the code for the previous commit)
  • 3f52f49 Merge origin/main into content-creative-tabs

📊 Changes

7 files changed (+470 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/container_screen.rs (+11 -0)
📝 crates/horizon-client/src/creative.rs (+47 -0)
📝 crates/horizon-client/src/game.rs (+87 -6)
📝 crates/horizon-client/src/mod_content.rs (+100 -2)
📝 crates/horizon-client/src/mod_content_tests.rs (+140 -0)
📝 crates/horizon-mods/src/content.rs (+70 -1)
📝 docs/mods.md (+15 -0)

📄 Description

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

Fixes #4331. Any content mod can add creative tabs as data, no code:

// data/<mod id>/horizon/creative_tab/gems.json
{ "title": "Gems", "icon": "gems:ruby", "items": ["gems:ruby", "minecraft:diamond"] }
  • Mod tabs come after vanilla's, ten to a page, as NeoForge pages them (top row's first five columns, then the bottom row's); < > buttons 50 px above the inventory turn the pages, with "n / m" between them. Search, saved hotbars, operator blocks and the inventory show on every page.
  • Items keep the file's order; items the game doesn't have are left out, a missing icon gives an empty button.
  • Mods' items (every content item, not only tabbed ones) join the search tab under their names.
  • The title is English; a lang file's itemGroup.<mod id>.<file name> translates it, like vanilla's itemGroup.* keys.

Changes since reservedbytes' test on the issue (thanks!):

  • Block items were in search twice: blocks' items are already among the plan's items.
  • The page buttons stretched the 200-wide button sprite into 20 px and lost their sides: they're drawn with blit_sprite now, nine-sliced as vanilla's Button.
  • Turning the page while on search, saved hotbars or the inventory keeps that tab.
  • Titles from the mod's lang (above).
  • Not changed: at GUI scale 3 on 720 px the buttons sit near the top, where the tutorial toast can cover >. NeoForge puts them at the same spot (topPos - 50), so I kept its layout.

Rebased on main at 13ce6bcc6 (main's tab export now carries operator flags; page sits beside them in Tab).

pr_ready (tools/pr_ready.py --quick, against origin/main at 13ce6bcc6)

Check Result
Scope ✅ 7 files, +416 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 495 passed
rustfmt ✅
clippy ✅
tests: horizon-client, horizon-mods ✅ 1384 passed
content root tests ✅ 8 passed (incl. creative_tabs_come_on_their_own_page)
launcher rustfmt / clippy / tests ✅ (re-run by hand after the first run hit a full disk)
Parity ➖ not run (--quick)

🤖 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/5066 **Author:** [@Sylviromi](https://github.com/Sylviromi) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `content-creative-tabs` --- ### 📝 Commits (6) - [`74ff545`](https://github.com/horizon-rust/horizon/commit/74ff545e60fbda2377255effa9c52fc0c346ec5d) Content mods: creative inventory tabs, paged as NeoForge pages them - [`a138c13`](https://github.com/horizon-rust/horizon/commit/a138c139ac63a88172476adf356c611daa0386e0) Creative tabs: block items once in search, nine-sliced page buttons, lang titles - [`9be1573`](https://github.com/horizon-rust/horizon/commit/9be1573e70053df781ae22e69aeffae259412597) Fix creative page releases and vanilla tab items - [`4c41466`](https://github.com/horizon-rust/horizon/commit/4c41466e2e98502f2f8b308420276bf082bc025e) Creative tabs: the title may be a lang key - [`ae1eb14`](https://github.com/horizon-rust/horizon/commit/ae1eb14b17627f95d2cb363116b6bbd2777cf9f8) Creative tabs: look the title up as a lang key (the code for the previous commit) - [`3f52f49`](https://github.com/horizon-rust/horizon/commit/3f52f4988f789281a2bac9a9655229d95b48954b) Merge origin/main into content-creative-tabs ### 📊 Changes **7 files changed** (+470 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/container_screen.rs` (+11 -0) 📝 `crates/horizon-client/src/creative.rs` (+47 -0) 📝 `crates/horizon-client/src/game.rs` (+87 -6) 📝 `crates/horizon-client/src/mod_content.rs` (+100 -2) 📝 `crates/horizon-client/src/mod_content_tests.rs` (+140 -0) 📝 `crates/horizon-mods/src/content.rs` (+70 -1) 📝 `docs/mods.md` (+15 -0) </details> ### 📄 Description > 🤖 Opened by Sylviromi's AI agent (Claude Code, Claude Opus 5.5), not by Sylviromi personally. Fixes #4331. Any content mod can add creative tabs as data, no code: ```json // data/<mod id>/horizon/creative_tab/gems.json { "title": "Gems", "icon": "gems:ruby", "items": ["gems:ruby", "minecraft:diamond"] } ``` - Mod tabs come after vanilla's, ten to a page, as NeoForge pages them (top row's first five columns, then the bottom row's); `<` `>` buttons 50 px above the inventory turn the pages, with "n / m" between them. Search, saved hotbars, operator blocks and the inventory show on every page. - Items keep the file's order; items the game doesn't have are left out, a missing icon gives an empty button. - Mods' items (every content item, not only tabbed ones) join the search tab under their names. - The title is English; a lang file's `itemGroup.<mod id>.<file name>` translates it, like vanilla's `itemGroup.*` keys. Changes since reservedbytes' test on the issue (thanks!): - Block items were in search twice: blocks' items are already among the plan's items. - The page buttons stretched the 200-wide button sprite into 20 px and lost their sides: they're drawn with `blit_sprite` now, nine-sliced as vanilla's `Button`. - Turning the page while on search, saved hotbars or the inventory keeps that tab. - Titles from the mod's lang (above). - Not changed: at GUI scale 3 on 720 px the buttons sit near the top, where the tutorial toast can cover `>`. NeoForge puts them at the same spot (`topPos - 50`), so I kept its layout. Rebased on main at 13ce6bcc6 (main's tab export now carries `operator` flags; `page` sits beside them in `Tab`). **pr_ready** (`tools/pr_ready.py --quick`, against origin/main at 13ce6bcc6) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +416 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 495 passed | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client, horizon-mods | ✅ 1384 passed | | content root tests | ✅ 8 passed (incl. `creative_tabs_come_on_their_own_page`) | | launcher rustfmt / clippy / tests | ✅ (re-run by hand after the first run hit a full disk) | | Parity | ➖ not run (--quick) | 🤖 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:16:47 +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#6037
No description provided.