From c97d9c3b01133493b30baeec912c496867873dc5 Mon Sep 17 00:00:00 2001 From: Filip Wandzio Date: Tue, 3 Feb 2026 16:34:38 +0100 Subject: Purge leftover comments --- src/minecraft/downloads.rs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/minecraft/downloads.rs') diff --git a/src/minecraft/downloads.rs b/src/minecraft/downloads.rs index a994146..7017d3f 100644 --- a/src/minecraft/downloads.rs +++ b/src/minecraft/downloads.rs @@ -16,7 +16,7 @@ use crate::{ #[derive(Debug, Deserialize)] struct AssetObject { hash: String, - size: u64, + // size: u64, } #[derive(Debug, Deserialize)] @@ -24,10 +24,6 @@ struct AssetIndexManifest { objects: std::collections::HashMap, } -/// Pobiera wszystko potrzebne do uruchomienia Minecraft: -/// - client jar -/// - biblioteki (artifact + natives) -/// - assets (w tym textures, sounds) pub async fn download_all( config: &Config, version: &Version, @@ -58,7 +54,6 @@ async fn download_libraries( libraries: &[Library], ) -> Result<(), McError> { for library in libraries { - // ===== CLASSPATH LIBRARIES ===== if let Some(artifact) = &library.downloads.artifact { let library_path = paths::library_file(config, &artifact.path)?; @@ -68,7 +63,6 @@ async fn download_libraries( } } - // ===== NATIVES ===== if let Some(classifiers) = &library.downloads.classifiers { for (_, native) in classifiers { let native_path = paths::library_file(config, &native.path)?; @@ -97,7 +91,6 @@ async fn download_asset_index( McError::Config("Missing asset_index in version.json".into()) })?; - // Nie pozwalamy na legacy dla nowoczesnych wersji if asset_index.id == "legacy" { return Err(McError::Config( "Legacy assetIndex detected – pobierz właściwy version.json".into(), @@ -108,14 +101,12 @@ async fn download_asset_index( .join("indexes") .join(format!("{}.json", asset_index.id)); - // Jeśli indeks istnieje lokalnie if index_path.exists() { let index_data = fs::read_to_string(&index_path).await?; let manifest: AssetIndexManifest = serde_json::from_str(&index_data)?; return Ok(manifest); } - // Pobierz indeks z sieci info!("Downloading asset index {}", asset_index.id); let response = get(&asset_index.url).await?; let manifest_text = response.text().await?; @@ -132,13 +123,11 @@ async fn download_assets( ) -> Result<(), McError> { let assets_dir = paths::assets_dir(config); - // Katalogi MUSZĄ istnieć create_dir_all(assets_dir.join("objects")).await?; create_dir_all(assets_dir.join("indexes")).await?; let manifest = download_asset_index(config, version).await?; - // Pobieramy wszystkie obiekty for (logical_path, asset) in &manifest.objects { let subdir = &asset.hash[0..2]; let file_path = assets_dir @@ -158,7 +147,6 @@ async fn download_assets( download_file(&url, &file_path).await?; } - // Pobierz sounds.json jeśli istnieje if let Some(asset) = manifest.objects.get("sounds.json") { let file_path = assets_dir.join("indexes").join("sounds.json"); if !file_path.exists() { @@ -175,7 +163,6 @@ async fn download_assets( Ok(()) } -/// Helper do pobierania plików async fn download_file( url: &str, path: &std::path::Path, -- cgit v1.2.3