1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! Building blocks for a Rust Minecraft launcher.
//!
//! `mc-launcher-core` focuses on the parts a launcher backend needs before it
//! can hand control to Java:
//!
//! - resolving and installing vanilla, Fabric, Quilt, Forge, and NeoForge
//! profiles;
//! - downloading client jars, libraries, assets, and native libraries;
//! - merging inherited version metadata into a launchable [`core::version::VersionJson`];
//! - building a [`command::builder::LaunchCommand`] that can be passed to
//! [`std::process::Command`];
//! - applying compatibility metadata for older Minecraft versions on macOS
//! Apple Silicon.
//!
//! The easiest entry point is [`launcher::Launcher`]. Most applications should
//! import [`prelude`] and keep lower-level modules for custom install or
//! inspection workflows.
//!
//! # Quick Start
//!
//! Install Fabric, load the resulting profile, build a launch command, and run
//! it with an offline account:
//!
//! ```no_run
//! use std::process::Command;
//!
//! use mc_launcher_core::prelude::*;
//!
//! fn main() -> mc_launcher_core::Result<()> {
//! let minecraft_dir = std::env::current_dir()?.join(".minecraft");
//! let launcher = Launcher::new(minecraft_dir);
//!
//! let install = launcher.install(InstallRequest {
//! minecraft_version: "1.20.1".to_string(),
//! loader: Some(LoaderSpec::Fabric {
//! version: LoaderVersion::LatestStable,
//! }),
//! java: JavaInstallPolicy::Auto,
//! })?;
//! let version = launcher.load_version(&install.version_id)?;
//!
//! let command = launcher.build_launch_command_from_version(
//! &version,
//! LaunchOptions {
//! account: Account::offline("Steve"),
//! ..Default::default()
//! },
//! )?;
//!
//! let mut child = Command::new(&command.executable)
//! .args(&command.args)
//! .current_dir(&command.working_dir)
//! .spawn()?;
//! child.wait()?;
//! Ok(())
//! }
//! ```
//!
//! # Module Map
//!
//! - [`prelude`] re-exports the stable facade types for launcher applications.
//! - [`launcher`] contains the high-level install and command-building facade.
//! - [`install`] plans and executes client, asset, library, loader, and native
//! installation work.
//! - [`command`] turns version metadata and launch options into Java process
//! arguments.
//! - [`compatibility`] adjusts metadata for known platform gaps such as legacy
//! macOS arm64 LWJGL support.
//! - [`auth`] contains offline and Microsoft account helpers.
//! - [`core`], [`io`], and [`net`] hold lower-level primitives used by the
//! facade.
//!
//! # Java Runtime
//!
//! The crate does not currently bundle or manage a production Java runtime for
//! the new facade. Use [`command::builder::LaunchOptions::java_executable`] to
//! point at the runtime your launcher selected. Older compatibility wrappers in
//! [`runtime`] are retained for existing callers.
//!
//! # Error Handling
//!
//! New facade APIs return [`Result`], an alias over [`LauncherError`]. Errors
//! preserve their source where possible, so callers can display simple messages
//! or inspect variants for recovery.
pub use ;