[PR #3598] [MERGED] Launcher: Play starts a Java instance's Minecraft #5083

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

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-java-play


📝 Commits (5)

  • a49e722 Merge branch 'feat/launcher-java-instances' into feat/launcher-java-play
  • dcd733c Launcher: play a Java instance from the command line
  • 7826732 Launcher: Play starts a Java instance's Minecraft
  • 99b52c2 Merge remote-tracking branch 'origin/main' into feat/launcher-java-play
  • 9e9b986 Merge remote-tracking branch 'origin/main' into feat/launcher-java-play

📊 Changes

13 files changed (+296 additions, -24 deletions)

View changed files

📝 docs/launcher-commands.md (+1 -1)
📝 launcher/lang/de.json (+5 -0)
📝 launcher/lang/fr.json (+1 -0)
📝 launcher/lang/ru.json (+1 -0)
📝 launcher/src/account.rs (+42 -0)
📝 launcher/src/account/tests.rs (+25 -0)
📝 launcher/src/backend.rs (+66 -0)
📝 launcher/src/cli.rs (+24 -1)
📝 launcher/src/i18n/tests.rs (+2 -0)
📝 launcher/src/instances.rs (+4 -4)
📝 launcher/src/instances_page.rs (+3 -0)
📝 launcher/src/java_launch.rs (+6 -0)
📝 launcher/src/main.rs (+116 -18)

📄 Description

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

Java instances (launcher), part 5: Play starts a Java instance's real Minecraft: Java Edition, from the window and from the command line. Builds on #3395 (Java instances), #3406 (any-version download for an owner) and #3419 (the start command from the version JSON).

Who plays (account::java_player). The owner gate itself (account::launch, the strict one): the selected account when it owns the game, else another that does. With no answer from the services, an account that owned it plays with its last token. Never anyone who doesn't own it. Mojang's game takes the token on its command line, as Mojang's launcher gives it; that command is never logged, java_launch::Player's Debug hides it, and an old version's "Session ID is" line never reaches the window.

The game (backend::java_game). The first time, the version is downloaded from Mojang for that owner (download_version_for_owner, #3406), with a .downloaded marker so it then starts offline too. The Java it needs: the instance's own Java home, else one found here, else Mojang's, downloaded (java::pick / java::install). Then java_launch::command in the instance's folder, wrapped by its launch settings.

Command line. horizon-launcher play --instance <java instance> starts it (--arg passes through). Options only Horizon has (--version, --world, --creative, --join, --server) are refused for a Java instance. docs/launcher-commands.md regenerated.

Window. With a Java instance selected, Play builds the game off the window's thread (its download lines in the log) and starts it as the Horizon client starts; no owner opens the sign-in screen, as for Horizon. The Play page says "Minecraft", needs no Horizon version, and shows a Game row ("Minecraft 1.21.4 (Java Edition). Play downloads it from Mojang for your account the first time, with the Java it needs.") in place of Horizon's resources and Minecraft folder rows. The sidebar shows the instance's version. Kept from #3451: Horizon's Play and every shortcut still go through can_start. A Java instance needs only "no game running", and the shortcuts (a server's Join, a world's Play, a friend's code) stay Horizon's (can_start_selected is false for a Java instance, so Join can't start Mojang's game without its server).

Translations test. It now also reads strings rustfmt moves to the line after tr( / trf(. That found one on main without German (#3506's delete confirmation), added here with its buttons.

Tests: the_java_edition_plays_as_an_owner_even_offline (owner plays with the session's token; offline with the last token; never a non-owner), plus the existing gate, java_launch and i18n tests. Checked in a scratch home: play --instance on a Java instance refuses before any download without an owning account; screenshot of the Play page with a Java instance. Not checked: a real game start (needs an account that owns the game; scratch homes have none, and real player data is off limits).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 2b294bbe3, 1 min 4 s)

Check Result
Scope ✅ 13 files, +297 −25
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed
launcher rustfmt ✅
launcher clippy ✅
launcher tests ✅ 252 passed
Parity ➖ lan_integration listed for CI (the launcher is not in the LAN suite)

🤖 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/3598 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-java-play` --- ### 📝 Commits (5) - [`a49e722`](https://github.com/horizon-rust/horizon/commit/a49e72201aa90ae8c758d7c9faf6bb990930af29) Merge branch 'feat/launcher-java-instances' into feat/launcher-java-play - [`dcd733c`](https://github.com/horizon-rust/horizon/commit/dcd733c7c18f04bb6dbc51c01d9d558c94d7212d) Launcher: play a Java instance from the command line - [`7826732`](https://github.com/horizon-rust/horizon/commit/7826732a5cd0ecedf25410e4942919ad8b0be083) Launcher: Play starts a Java instance's Minecraft - [`99b52c2`](https://github.com/horizon-rust/horizon/commit/99b52c26177b9c96144fa3b47489cffb4d31855e) Merge remote-tracking branch 'origin/main' into feat/launcher-java-play - [`9e9b986`](https://github.com/horizon-rust/horizon/commit/9e9b9862ee072dd4451d9204578dede16b21e569) Merge remote-tracking branch 'origin/main' into feat/launcher-java-play ### 📊 Changes **13 files changed** (+296 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+1 -1) 📝 `launcher/lang/de.json` (+5 -0) 📝 `launcher/lang/fr.json` (+1 -0) 📝 `launcher/lang/ru.json` (+1 -0) 📝 `launcher/src/account.rs` (+42 -0) 📝 `launcher/src/account/tests.rs` (+25 -0) 📝 `launcher/src/backend.rs` (+66 -0) 📝 `launcher/src/cli.rs` (+24 -1) 📝 `launcher/src/i18n/tests.rs` (+2 -0) 📝 `launcher/src/instances.rs` (+4 -4) 📝 `launcher/src/instances_page.rs` (+3 -0) 📝 `launcher/src/java_launch.rs` (+6 -0) 📝 `launcher/src/main.rs` (+116 -18) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Java instances (launcher), part 5: **Play starts a Java instance's real Minecraft: Java Edition**, from the window and from the command line. Builds on #3395 (Java instances), #3406 (any-version download for an owner) and #3419 (the start command from the version JSON). **Who plays (`account::java_player`).** The owner gate itself (`account::launch`, the strict one): the selected account when it owns the game, else another that does. With no answer from the services, an account that owned it plays with its last token. Never anyone who doesn't own it. Mojang's game takes the token on its command line, as Mojang's launcher gives it; that command is never logged, `java_launch::Player`'s Debug hides it, and an old version's "Session ID is" line never reaches the window. **The game (`backend::java_game`).** The first time, the version is downloaded from Mojang for that owner (`download_version_for_owner`, #3406), with a `.downloaded` marker so it then starts offline too. The Java it needs: the instance's own Java home, else one found here, else Mojang's, downloaded (`java::pick` / `java::install`). Then `java_launch::command` in the instance's folder, wrapped by its launch settings. **Command line.** `horizon-launcher play --instance <java instance>` starts it (`--arg` passes through). Options only Horizon has (`--version`, `--world`, `--creative`, `--join`, `--server`) are refused for a Java instance. docs/launcher-commands.md regenerated. **Window.** With a Java instance selected, Play builds the game off the window's thread (its download lines in the log) and starts it as the Horizon client starts; no owner opens the sign-in screen, as for Horizon. The Play page says "Minecraft", needs no Horizon version, and shows a **Game** row ("Minecraft 1.21.4 (Java Edition). Play downloads it from Mojang for your account the first time, with the Java it needs.") in place of Horizon's resources and Minecraft folder rows. The sidebar shows the instance's version. Kept from #3451: Horizon's Play and every shortcut still go through `can_start`. A Java instance needs only "no game running", and the shortcuts (a server's Join, a world's Play, a friend's code) stay Horizon's (`can_start_selected` is false for a Java instance, so Join can't start Mojang's game without its server). **Translations test.** It now also reads strings rustfmt moves to the line after `tr(` / `trf(`. That found one on main without German (#3506's delete confirmation), added here with its buttons. Tests: `the_java_edition_plays_as_an_owner_even_offline` (owner plays with the session's token; offline with the last token; never a non-owner), plus the existing gate, java_launch and i18n tests. Checked in a scratch home: `play --instance` on a Java instance refuses before any download without an owning account; screenshot of the Play page with a Java instance. **Not checked: a real game start** (needs an account that owns the game; scratch homes have none, and real player data is off limits). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 2b294bbe3, 1 min 4 s) | Check | Result | | --- | --- | | Scope | ✅ 13 files, +297 −25 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed | | launcher rustfmt | ✅ | | launcher clippy | ✅ | | launcher tests | ✅ 252 passed | | Parity | ➖ lan_integration listed for CI (the launcher is not in the LAN suite) | 🤖 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:07 +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#5083
No description provided.