Modpacks from the mod browser: ported in the same step, mods loaded together

Importing a modpack from the Mods page (or `mods install`) now ports it right away
for the selected version, so Play works straight after. port-pack leaves a
namespace two carried mods both claim to none of them (YUNG's mods all ship
`yungsapi`, which made the game drop three of them), and the launcher applies
the game's first-wins rule before it starts a pack, listing what it left off.

Measured on Vanilla Perfected, Slimes Adventure and All the Mods 10 (docs/modpacks.md):
2, 20 and 42 mods ported, every world loads, no crash.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-22 18:28:58 +02:00
parent f53998674d
commit f926d1d2b1
9 changed files with 243 additions and 20 deletions
+7 -7
View File
@@ -1053,13 +1053,13 @@ fn mods(action: ModsCmd, as_json: bool) -> Result<(), String> {
let file =
installed::fetch_modpack(&*source, &p, &folder, &progress(p.title.clone()))?;
let log = &|line: String| eprintln!("{line}");
let pack = modpacks::import(&file, log)?;
println!(
"Imported {} ({}): horizon-launcher modpack port {}",
pack.title(),
pack.summary(),
pack.slug
);
let resources = backend::resolve_version(None)
.ok()
.filter(|t| backend::is_prepared(t))
.map(|t| backend::resources(&t));
let pack = modpacks::import_and_port(&file, resources.as_deref(), log)?;
println!("{} ({})", modpacks::outcome(&pack), pack.summary());
println!("Play it: horizon-launcher modpack play {}", pack.slug);
return Ok(());
}
let done = installed::install(&*source, &p, everything, &home, &line)?;