[PR #1986] [MERGED] Prepare: the CLI finds Minecraft 26.3 in ATLauncher and the CurseForge app #3917

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1986
Author: @some-du6e
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/prepare-atlauncher


📝 Commits (2)

  • 97e78e0 horizon-prepare: find 26.3 in ATLauncher's and the CurseForge app's folders
  • 7abae79 Merge main into fix/prepare-atlauncher

📊 Changes

3 files changed (+263 additions, -41 deletions)

View changed files

📝 crates/horizon-prepare/src/artifacts.rs (+250 -32)
📝 crates/horizon-prepare/src/lib.rs (+1 -1)
📝 crates/horizon-prepare/src/sounds.rs (+12 -8)

📄 Description

What the player hit

A Windows player who plays only through ATLauncher ran horizon-prepare.exe --prepare and got Missing C:\Users\<user>\AppData\Roaming\.minecraft\versions\26.3\26.3.json, though they had played 26.3 in an ATLauncher instance. horizon-prepare only read the official launcher's layout, and only in the official launcher's folder.

ATLauncher's layout (from its source)

  • Version JSON: configs/json/minecraft/<v>.json, Mojang's file as is: InstanceInstaller.downloadMinecraftVersionJson downloads it hash-checked against the version manifest's sha1, so the lock's manifest_sha1 pin accepts it.
  • Client jar: libraries/net/minecraft/client/<v>/client-<v>.jar (getMinecraftJarLibraryPath).
  • Libraries and natives: libraries/<downloads.artifact.path>, not renamed (downloadLibraries).
  • Assets: assets/indexes, assets/objects. Java runtimes: runtimes/minecraft/<component>/<platform>/<component>.
  • Folder: %APPDATA%\ATLauncher (Windows installer), ATLauncher.app/Contents/Java on macOS (the app sets user.dir there), $XDG_DATA_HOME/atlauncher (deb, rpm, AUR), ~/.var/app/com.atlauncher.ATLauncher/data (Flatpak). A portable copy is wherever it was unzipped: --minecraft-dir.

Fix (horizon-prepare)

  • game_files finds the pinned version's files in the official layout or ATLauncher's: in the chosen folder (--minecraft-dir, HORIZON_MINECRAFT_DIR) and the launcher above it when an instances/<name> folder is chosen; with none chosen, in the official launcher's folder, then ATLauncher's, then the CurseForge app's Install folder (it runs the official launcher there). A folder with both the version JSON and the jar wins over one holding a stray version JSON.
  • The import, the asset steps (sounds, panorama, fonts, packs, languages) and the Java runtime search use it. The pins gate everything exactly as before; nothing is downloaded.
  • The error lists every folder looked in with its launcher, and says which launchers the CLI reads and that Prism Launcher, MultiMC, the Modrinth App and GDLauncher are prepared from the Horizon launcher.

Example, Windows, nothing found:

Missing C:\Users\<user>\AppData\Roaming\.minecraft\versions\26.3\26.3.json. Horizon does not download the game: … Horizon looked for 26.3 in:
  C:\Users\<user>\AppData\Roaming\.minecraft (the official launcher)
  C:\Users\<user>\AppData\Roaming\ATLauncher (ATLauncher)
  C:\Users\<user>\curseforge\minecraft\Install (the CurseForge app)

Other launchers (surveyed from their source/docs, not changed here)

Launcher Version JSON Mojang's bytes? CLI
Official (incl. macOS ~/Library/Application Support/minecraft) versions/<v>/<v>.json yes already read
CurseForge app curseforge/minecraft/Install/versions/<v>/<v>.json (official launcher inside) likely; unconfirmed in its "CurseForge launcher" beta mode now looked in; the pins decide
Prism Launcher, MultiMC, PolyMC meta/net.minecraft/<v>.json, own format no Horizon launcher (sources.rs)
Modrinth App meta/versions/<v>/<v>.json, re-serialized from Modrinth's meta no Horizon launcher
GDLauncher (Carbon) in its SQLite database no Horizon launcher

Supporting those in the CLI would need Mojang's version JSON from elsewhere (they keep the pinned client sha1, but not the version file), so it stays with the Horizon launcher. Follow-ups noticed in launcher/src/sources.rs: ATLauncher's macOS folder is ATLauncher.app/Contents/Java, not ~/Library/Application Support/ATLauncher, and its Flatpak folder is .../data, not .../data/atlauncher; it could also take ATLauncher's own version JSON instead of downloading Mojang's.

Overlaps #1869 in import_manifest (a one-line source change here); whichever merges second rebases.

Tests

New: artifacts::tests::an_atlauncher_install_prepares (fake ATLauncher tree, from the root and an instance folder; a wrong client jar and a rewritten version JSON are refused), the_error_names_the_folders_looked_in, every_launcher_horizon_reads_is_looked_in. No Mojang files.

pr_ready (tools/pr_ready.py --quick on swiss, against origin/main at d58d26c79, 22 s)

Check Result
Scope ✅ 3 files, +258 −39
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ➖ no Python change
rustfmt ✅ (10 s)
clippy ✅ (1 s)
tests: horizon-prepare ✅ 35 passed (3 s)
doc tests ✅ 0 passed (1 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (1 s)
launcher tests ✅ 128 passed (4 s)
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)

Note

Filed by Claude Opus 5.5 using 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/1986 **Author:** [@some-du6e](https://github.com/some-du6e) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/prepare-atlauncher` --- ### 📝 Commits (2) - [`97e78e0`](https://github.com/horizon-rust/horizon/commit/97e78e0f11565ab89a7017b82784a56e4e47431a) horizon-prepare: find 26.3 in ATLauncher's and the CurseForge app's folders - [`7abae79`](https://github.com/horizon-rust/horizon/commit/7abae79d41bd7027fc24ac8815c2756daa2991f7) Merge main into fix/prepare-atlauncher ### 📊 Changes **3 files changed** (+263 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-prepare/src/artifacts.rs` (+250 -32) 📝 `crates/horizon-prepare/src/lib.rs` (+1 -1) 📝 `crates/horizon-prepare/src/sounds.rs` (+12 -8) </details> ### 📄 Description ## What the player hit A Windows player who plays only through ATLauncher ran `horizon-prepare.exe --prepare` and got `Missing C:\Users\<user>\AppData\Roaming\.minecraft\versions\26.3\26.3.json`, though they had played 26.3 in an ATLauncher instance. horizon-prepare only read the official launcher's layout, and only in the official launcher's folder. ## ATLauncher's layout (from its source) - Version JSON: `configs/json/minecraft/<v>.json`, Mojang's file as is: `InstanceInstaller.downloadMinecraftVersionJson` downloads it hash-checked against the version manifest's sha1, so the lock's `manifest_sha1` pin accepts it. - Client jar: `libraries/net/minecraft/client/<v>/client-<v>.jar` (`getMinecraftJarLibraryPath`). - Libraries and natives: `libraries/<downloads.artifact.path>`, not renamed (`downloadLibraries`). - Assets: `assets/indexes`, `assets/objects`. Java runtimes: `runtimes/minecraft/<component>/<platform>/<component>`. - Folder: `%APPDATA%\ATLauncher` (Windows installer), `ATLauncher.app/Contents/Java` on macOS (the app sets `user.dir` there), `$XDG_DATA_HOME/atlauncher` (deb, rpm, AUR), `~/.var/app/com.atlauncher.ATLauncher/data` (Flatpak). A portable copy is wherever it was unzipped: `--minecraft-dir`. ## Fix (horizon-prepare) - `game_files` finds the pinned version's files in the official layout or ATLauncher's: in the chosen folder (`--minecraft-dir`, `HORIZON_MINECRAFT_DIR`) and the launcher above it when an `instances/<name>` folder is chosen; with none chosen, in the official launcher's folder, then ATLauncher's, then the CurseForge app's `Install` folder (it runs the official launcher there). A folder with both the version JSON and the jar wins over one holding a stray version JSON. - The import, the asset steps (sounds, panorama, fonts, packs, languages) and the Java runtime search use it. The pins gate everything exactly as before; nothing is downloaded. - The error lists every folder looked in with its launcher, and says which launchers the CLI reads and that Prism Launcher, MultiMC, the Modrinth App and GDLauncher are prepared from the Horizon launcher. Example, Windows, nothing found: ``` Missing C:\Users\<user>\AppData\Roaming\.minecraft\versions\26.3\26.3.json. Horizon does not download the game: … Horizon looked for 26.3 in: C:\Users\<user>\AppData\Roaming\.minecraft (the official launcher) C:\Users\<user>\AppData\Roaming\ATLauncher (ATLauncher) C:\Users\<user>\curseforge\minecraft\Install (the CurseForge app) ``` ## Other launchers (surveyed from their source/docs, not changed here) | Launcher | Version JSON | Mojang's bytes? | CLI | |---|---|---|---| | Official (incl. macOS `~/Library/Application Support/minecraft`) | `versions/<v>/<v>.json` | yes | already read | | CurseForge app | `curseforge/minecraft/Install/versions/<v>/<v>.json` (official launcher inside) | likely; unconfirmed in its "CurseForge launcher" beta mode | now looked in; the pins decide | | Prism Launcher, MultiMC, PolyMC | `meta/net.minecraft/<v>.json`, own format | no | Horizon launcher (sources.rs) | | Modrinth App | `meta/versions/<v>/<v>.json`, re-serialized from Modrinth's meta | no | Horizon launcher | | GDLauncher (Carbon) | in its SQLite database | no | Horizon launcher | Supporting those in the CLI would need Mojang's version JSON from elsewhere (they keep the pinned client sha1, but not the version file), so it stays with the Horizon launcher. Follow-ups noticed in `launcher/src/sources.rs`: ATLauncher's macOS folder is `ATLauncher.app/Contents/Java`, not `~/Library/Application Support/ATLauncher`, and its Flatpak folder is `.../data`, not `.../data/atlauncher`; it could also take ATLauncher's own version JSON instead of downloading Mojang's. Overlaps #1869 in `import_manifest` (a one-line source change here); whichever merges second rebases. ## Tests New: `artifacts::tests::an_atlauncher_install_prepares` (fake ATLauncher tree, from the root and an instance folder; a wrong client jar and a rewritten version JSON are refused), `the_error_names_the_folders_looked_in`, `every_launcher_horizon_reads_is_looked_in`. No Mojang files. **pr_ready** (`tools/pr_ready.py --quick` on swiss, against origin/main at d58d26c79, 22 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +258 −39 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ➖ no Python change | | rustfmt | ✅ (10 s) | | clippy | ✅ (1 s) | | tests: horizon-prepare | ✅ 35 passed (3 s) | | doc tests | ✅ 0 passed (1 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (1 s) | | launcher tests | ✅ 128 passed (4 s) | | 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) | > [!NOTE] > Filed by Claude Opus 5.5 using 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:13:15 +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#3917
No description provided.