[PR #2612] [MERGED] Launcher: data packs into a world #4471

Closed
opened 2026-11-03 04:17:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-datapacks


📝 Commits (1)

  • aa6fdac Launcher: data packs into a world

📊 Changes

11 files changed (+640 additions, -4 deletions)

View changed files

📝 docs/launcher-commands.md (+35 -0)
📝 launcher/README.md (+5 -1)
📝 launcher/src/cli.rs (+62 -0)
📝 launcher/src/cli_tools.rs (+1 -0)
➕ launcher/src/datapacks.rs (+156 -0)
➕ launcher/src/datapacks/tests.rs (+103 -0)
➕ launcher/src/datapacks_page.rs (+255 -0)
📝 launcher/src/lib.rs (+1 -0)
📝 launcher/src/main.rs (+3 -0)
📝 launcher/src/packs.rs (+2 -2)
📝 launcher/src/worlds_page.rs (+17 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read.

Item 9 of the launcher features, part 1 of 2: data packs from a zip. Part 2 (Modrinth's data pack type in the Mods browser, installing into a chosen world) comes next. Stacked on #2609.

What

  • datapacks.rs: a world's datapacks/, read the way the game reads it (horizon-client/src/datapack.rs discover: zips and folders with a pack.mcmeta). A pack counts as off when the world's datapacks.json (where the game's /datapack disable writes) lists it disabled; the game turns on every other pack it finds when the world opens or on /reload, so adding one means copying it in.
  • add takes a zip with a pack.mcmeta and a data/ folder (a resource pack is refused, with the reason), copies it in under a free name (Trades (2).zip), and drops a stale entry of the same name from datapacks.json so a re-added pack doesn't come back off. remove moves it to the trash (through #2604's seam) and forgets it there.
  • Home: each world row gets Data packs. It opens the world's packs under the row ("Off in the game" for disabled ones), with Add data pack…, Open folder and Remove (asks first). A data pack zip dropped on a world row goes into that world; the row is outlined while dragging.
  • CLI: horizon-launcher worlds datapack-list|datapack-add|datapack-remove <world> … [--instance]. MCP: generated; worlds datapack-remove needs confirm: true. docs/launcher-commands.md regenerated.

Screenshots (scratch homes, generated packs; trash and clipboard in scratch folders)

A world's packs, one turned off in the game:
open

Dragging a zip onto another world, then dropped:
hover
dropped

Remove asks first:
confirm

Proof

  • New unit test: listing (folder and zip, disabled from datapacks.json, non-packs left out), adding (free name, a re-added disabled pack comes back on, a resource pack refused), removing (into a test trash folder, forgotten in datapacks.json).
  • CLI by hand: datapack-add Castle "Coordinates HUD.zip" → added; with a resource pack → "Clear Glass.zip has no data folder: it is a resource pack, not a data pack."; datapack-remove → in the scratch trash; ~/.Trash unchanged (37).
  • cargo fmt --check, cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings: clean; cargo test --locked --lib 156 passed, --bin horizon-launcher 35 passed.

🤖 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/2612 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-datapacks` --- ### 📝 Commits (1) - [`aa6fdac`](https://github.com/horizon-rust/horizon/commit/aa6fdac5018a11026a6e7947c8e010e1e44f06ed) Launcher: data packs into a world ### 📊 Changes **11 files changed** (+640 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+35 -0) 📝 `launcher/README.md` (+5 -1) 📝 `launcher/src/cli.rs` (+62 -0) 📝 `launcher/src/cli_tools.rs` (+1 -0) ➕ `launcher/src/datapacks.rs` (+156 -0) ➕ `launcher/src/datapacks/tests.rs` (+103 -0) ➕ `launcher/src/datapacks_page.rs` (+255 -0) 📝 `launcher/src/lib.rs` (+1 -0) 📝 `launcher/src/main.rs` (+3 -0) 📝 `launcher/src/packs.rs` (+2 -2) 📝 `launcher/src/worlds_page.rs` (+17 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Clean room: designed from the feature list in briefs/launcher-features-1.md; no other launcher's code, docs or assets were read. Item 9 of the launcher features, part 1 of 2: data packs from a zip. Part 2 (Modrinth's data pack type in the Mods browser, installing into a chosen world) comes next. Stacked on #2609. ## What - `datapacks.rs`: a world's `datapacks/`, read the way the game reads it (`horizon-client/src/datapack.rs` `discover`: zips and folders with a `pack.mcmeta`). A pack counts as off when the world's `datapacks.json` (where the game's `/datapack disable` writes) lists it disabled; the game turns on every other pack it finds when the world opens or on `/reload`, so adding one means copying it in. - `add` takes a zip with a `pack.mcmeta` **and** a `data/` folder (a resource pack is refused, with the reason), copies it in under a free name (`Trades (2).zip`), and drops a stale entry of the same name from `datapacks.json` so a re-added pack doesn't come back off. `remove` moves it to the trash (through #2604's seam) and forgets it there. - Home: each world row gets **Data packs**. It opens the world's packs under the row ("Off in the game" for disabled ones), with **Add data pack…**, **Open folder** and **Remove** (asks first). A data pack zip dropped on a world row goes into that world; the row is outlined while dragging. - CLI: `horizon-launcher worlds datapack-list|datapack-add|datapack-remove <world> … [--instance]`. MCP: generated; `worlds datapack-remove` needs `confirm: true`. `docs/launcher-commands.md` regenerated. ## Screenshots (scratch homes, generated packs; trash and clipboard in scratch folders) A world's packs, one turned off in the game: ![open](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/item-09-datapacks/dp_1.png) Dragging a zip onto another world, then dropped: ![hover](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/item-09-datapacks/dp_hover.png) ![dropped](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/item-09-datapacks/dp_2.png) Remove asks first: ![confirm](https://raw.githubusercontent.com/ludovic111/horizon/screenshots/launcher-features/item-09-datapacks/dp_3.png) ## Proof - New unit test: listing (folder and zip, disabled from datapacks.json, non-packs left out), adding (free name, a re-added disabled pack comes back on, a resource pack refused), removing (into a test trash folder, forgotten in datapacks.json). - CLI by hand: `datapack-add Castle "Coordinates HUD.zip"` → added; with a resource pack → "Clear Glass.zip has no data folder: it is a resource pack, not a data pack."; `datapack-remove` → in the scratch trash; `~/.Trash` unchanged (37). - `cargo fmt --check`, `cargo clippy --all-targets --locked --features gpui/runtime_shaders -- -D warnings`: clean; `cargo test --locked --lib` 156 passed, `--bin horizon-launcher` 35 passed. 🤖 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 04:17:23 +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#4471
No description provided.