[PR #3718] [MERGED] Launcher: turn single mods on and off in Java instances #5165

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

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-java-mod-toggle


📝 Commits (1)

  • 2dd4903 Launcher: turn single mods on and off in Java instances

📊 Changes

5 files changed (+112 additions, -22 deletions)

View changed files

📝 docs/launcher-commands.md (+2 -2)
📝 launcher/src/browser/java_instance.rs (+51 -5)
📝 launcher/src/browser/java_instance/tests.rs (+23 -3)
📝 launcher/src/cli.rs (+14 -8)
📝 launcher/src/mods_page.rs (+22 -4)

📄 Description

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

Another Java-instance gap: a mod installed by the browser can now be turned off and back on without removing it.

  • How it works: turning a mod off renames its file mods/<name>.jar to <name>.jar.disabled. Fabric and Quilt load only the .jar files in mods/, so the mod stays installed but isn't loaded. Other launchers use the same naming, so a folder copied from them keeps its mods off.
  • Updates: a mod that's off stays off after an update, and its old file is removed. Prism users report the opposite problem in #4537: updating a disabled mod there turns it on and leaves the old file behind.
  • Remove: removes the file in either state.
  • Window: a Java instance's mod rows on the mods page get the same On/Off switch as Horizon mods. Resource packs don't get one, since the game's options choose those.
  • CLI: mods enable|disable <project> --instance <java> now works; before, it refused with "remove one to turn it off". mods list marks a mod that's off with "(off)".

Sources: the public reports of the .jar.disabled naming: Prism #4537 and Prism #3578. No launcher's source was read.

Speed: the mods page checks one file per installed-mod row each time it draws. The list only draws visible rows. A temporary timing test over 100 mods measured 1.08 µs per row on the Mac mini. The Horizon rows already read horizon-mods.txt per row.

Checked by hand in scratch homes:

  • created a Fabric 1.21.1 instance;
  • installed Sodium and Mod Menu from Modrinth;
  • mods disable sodium --instance Fab left sodium-fabric-0.8.13+mc1.21.1.jar.disabled, and mods list showed "Sodium (off)";
  • the mods page showed Sodium's switch Off and the other mods On.

Test: installs_jars_with_dependencies_then_updates_and_removes now also covers turning a mod off and back on, keeping it off through an update (the old file goes), and removing it while it's off.

Nothing here reaches Mojang's files or the account checks.

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

Check Result
Scope ✅ 5 files, +112 −22
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 416 passed (1 min 48 s)
rustfmt ➖ no Rust change
clippy ➖ no Rust change
tests ➖ no crate touched
doc tests ➖ no crate touched
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (6 s)
launcher tests ✅ 269 passed (9 s)
Parity ➖ 1 affected, to run in CI (--quick): lan_integration
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/3718 **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-mod-toggle` --- ### 📝 Commits (1) - [`2dd4903`](https://github.com/horizon-rust/horizon/commit/2dd4903b5e37219076e0d00aca76d207d2a0483b) Launcher: turn single mods on and off in Java instances ### 📊 Changes **5 files changed** (+112 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/launcher-commands.md` (+2 -2) 📝 `launcher/src/browser/java_instance.rs` (+51 -5) 📝 `launcher/src/browser/java_instance/tests.rs` (+23 -3) 📝 `launcher/src/cli.rs` (+14 -8) 📝 `launcher/src/mods_page.rs` (+22 -4) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Another Java-instance gap: a mod installed by the browser can now be turned off and back on without removing it. - **How it works:** turning a mod off renames its file `mods/<name>.jar` to `<name>.jar.disabled`. Fabric and Quilt load only the `.jar` files in `mods/`, so the mod stays installed but isn't loaded. Other launchers use the same naming, so a folder copied from them keeps its mods off. - **Updates:** a mod that's off stays off after an update, and its old file is removed. Prism users report the opposite problem in [#4537](https://github.com/PrismLauncher/PrismLauncher/issues/4537): updating a disabled mod there turns it on and leaves the old file behind. - **Remove:** removes the file in either state. - **Window:** a Java instance's mod rows on the mods page get the same On/Off switch as Horizon mods. Resource packs don't get one, since the game's options choose those. - **CLI:** `mods enable|disable <project> --instance <java>` now works; before, it refused with "remove one to turn it off". `mods list` marks a mod that's off with "(off)". Sources: the public reports of the `.jar.disabled` naming: [Prism #4537](https://github.com/PrismLauncher/PrismLauncher/issues/4537) and [Prism #3578](https://github.com/PrismLauncher/PrismLauncher/issues/3578). No launcher's source was read. **Speed:** the mods page checks one file per installed-mod row each time it draws. The list only draws visible rows. A temporary timing test over 100 mods measured **1.08 µs per row** on the Mac mini. The Horizon rows already read `horizon-mods.txt` per row. **Checked by hand** in scratch homes: - created a Fabric 1.21.1 instance; - installed Sodium and Mod Menu from Modrinth; - `mods disable sodium --instance Fab` left `sodium-fabric-0.8.13+mc1.21.1.jar.disabled`, and `mods list` showed "Sodium (off)"; - the mods page showed Sodium's switch Off and the other mods On. **Test:** `installs_jars_with_dependencies_then_updates_and_removes` now also covers turning a mod off and back on, keeping it off through an update (the old file goes), and removing it while it's off. Nothing here reaches Mojang's files or the account checks. **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at ed45e27d1, 2 min 7 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +112 −22 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 416 passed (1 min 48 s) | | rustfmt | ➖ no Rust change | | clippy | ➖ no Rust change | | tests | ➖ no crate touched | | doc tests | ➖ no crate touched | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (6 s) | | launcher tests | ✅ 269 passed (9 s) | | Parity | ➖ 1 affected, to run in CI (--quick): lan_integration | | 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:42 +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#5165
No description provided.