Launcher: instances, each with its own game folder

The game's folder stays the default instance, "Horizon", where it is; imported
and registry modpacks are listed as instances in their own folders; new ones
go to instances/<slug>/ in the game's folder, empty (the player's options and
offline name) or a copy of another (never sessions, logs or telemetry). Names,
icons and groups live in the launcher's instances.json, so nothing moves.
Play, `play --instance` and MCP play start the selected instance, which
follows the launcher's data collection answer and No AI. Crash reports are
read from the run's own folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-27 01:13:35 +01:00
parent a727f617f0
commit 1d0d827f3a
11 changed files with 823 additions and 12 deletions
+7 -3
View File
@@ -1585,9 +1585,10 @@ pub fn newest_crash_report() -> Option<PathBuf> {
crash_reports_in(&crash_reports_dir()).pop()
}
/// The newest crash report written at or after `since` (one from the run that started then).
pub fn crash_report_since(since: std::time::SystemTime) -> Option<PathBuf> {
crash_report_in_since(&crash_reports_dir(), since)
/// The newest crash report the game playing in `home` wrote at or after `since` (one from the
/// run that started then).
pub fn crash_report_since(home: &Path, since: std::time::SystemTime) -> Option<PathBuf> {
crash_report_in_since(&home.join("crash-reports"), since)
}
fn crash_report_in_since(dir: &Path, since: std::time::SystemTime) -> Option<PathBuf> {
@@ -2517,6 +2518,9 @@ pub enum Appearance {
#[derive(Default, serde::Serialize, serde::Deserialize)]
pub struct Settings {
pub selected: Option<String>,
/// The instance Play starts (`instances`), by id. Unset means Horizon, the game's home.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub instance: Option<String>,
pub minecraft_dir: Option<PathBuf>,
pub server_dir: Option<PathBuf>,
/// Unset means on: only a player who turned it off has `false` here. 0.1.1 wrote its