diff options
| author | Filip Wandzio <contact@philw.dev> | 2026-01-24 08:29:14 +0100 |
|---|---|---|
| committer | Filip Wandzio <contact@philw.dev> | 2026-01-24 08:29:14 +0100 |
| commit | a393e0a2f2c3678a3ea869dc1417fa269f2b1040 (patch) | |
| tree | 606df6a9284b5bd2dbf84fa5e3d363b8e6a01322 /src/main.rs | |
| parent | 72ddd7b7704f2087a52c9c0552446682918c513b (diff) | |
| download | dml-a393e0a2f2c3678a3ea869dc1417fa269f2b1040.tar.gz dml-a393e0a2f2c3678a3ea869dc1417fa269f2b1040.zip | |
Resolve audio not loading bug
Ensure all assets are downloading for each version
Temporarily disable minecraft versions older than 1.8 because of the asset/manifest loading issues
Implement basic documentation of modules
Implement basic async/multithreading for downloading assets
Diffstat (limited to '')
| -rw-r--r-- | src/main.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main.rs b/src/main.rs index 8a01b9f..e229a3e 100644 --- a/src/main.rs +++ b/src/main.rs | |||
| @@ -8,9 +8,15 @@ mod util; | |||
| 8 | 8 | ||
| 9 | use clap::Parser; | 9 | use clap::Parser; |
| 10 | use config::Config; | 10 | use config::Config; |
| 11 | use dotenvy::dotenv; | ||
| 11 | use errors::McError; | 12 | use errors::McError; |
| 12 | use log::{debug, info}; | 13 | use log::{debug, info}; |
| 13 | 14 | ||
| 15 | use crate::minecraft::{ | ||
| 16 | downloads::download_all, extraction::extract_natives, launcher::launch, | ||
| 17 | manifests, | ||
| 18 | }; | ||
| 19 | |||
| 14 | #[derive(Parser, Debug)] | 20 | #[derive(Parser, Debug)] |
| 15 | #[command(author, about, disable_version_flag = true)] | 21 | #[command(author, about, disable_version_flag = true)] |
| 16 | struct Cli { | 22 | struct Cli { |
| @@ -26,7 +32,7 @@ struct Cli { | |||
| 26 | 32 | ||
| 27 | #[tokio::main] | 33 | #[tokio::main] |
| 28 | async fn main() -> Result<(), McError> { | 34 | async fn main() -> Result<(), McError> { |
| 29 | dotenvy::dotenv().ok(); | 35 | dotenv().ok(); |
| 30 | env_logger::init(); | 36 | env_logger::init(); |
| 31 | 37 | ||
| 32 | let cli = Cli::parse(); | 38 | let cli = Cli::parse(); |
| @@ -48,13 +54,13 @@ async fn main() -> Result<(), McError> { | |||
| 48 | platform::paths::ensure_dirs(&config)?; | 54 | platform::paths::ensure_dirs(&config)?; |
| 49 | info!("Using Minecraft version {}", config.version); | 55 | info!("Using Minecraft version {}", config.version); |
| 50 | 56 | ||
| 51 | let version = minecraft::manifests::load_version(&config).await?; | 57 | let version = manifests::load_version(&config).await?; |
| 52 | info!("Loaded version manifest for: {}", version.id); | 58 | info!("Loaded version manifest for: {}", version.id); |
| 53 | debug!("Main class: {}", version.main_class); | 59 | debug!("Main class: {}", version.main_class); |
| 54 | 60 | ||
| 55 | minecraft::downloads::download_all(&config, &version).await?; | 61 | download_all(&config, &version).await?; |
| 56 | minecraft::extraction::extract_natives(&config, &version)?; | 62 | extract_natives(&config, &version)?; |
| 57 | minecraft::launcher::launch(&config, &version)?; | 63 | launch(&config, &version)?; |
| 58 | 64 | ||
| 59 | Ok(()) | 65 | Ok(()) |
| 60 | } | 66 | } |
