Skip to content

Commit 93ae24e

Browse files
committed
Fix forge format version 1
1 parent 0ae1e40 commit 93ae24e

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

daedalus/src/minecraft.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,8 @@ pub struct VersionInfo {
430430
/// The minimum version of the Minecraft Launcher that can run this version of the game
431431
pub minimum_launcher_version: u32,
432432
/// The time that the version was released
433-
#[cfg_attr(feature = "bincode", bincode(with_serde))]
434433
pub release_time: DateTime<Utc>,
435434
/// The latest time a file in this version was updated
436-
#[cfg_attr(feature = "bincode", bincode(with_serde))]
437435
pub time: DateTime<Utc>,
438436
#[serde(rename = "type")]
439437
/// The type of version

daedalus_client/src/forge.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::util::{
2-
download_file, fetch_json, fetch_xml, format_url, sha1_async,
2+
download_file, fetch_json, fetch_xml, format_url,
33
};
44
use crate::{insert_mirrored_artifact, Error, MirrorArtifact, UploadFile};
55
use chrono::{DateTime, Utc};
@@ -403,9 +403,10 @@ async fn fetch(
403403
.map(|mut lib| {
404404
// For all libraries besides the forge lib extracted, we mirror them from maven servers
405405
// unless the URL is empty/null or available on Minecraft's servers
406-
if let Some(url) = lib.url {
407-
if lib.name != install_profile.install.path
408-
&& !url.is_empty()
406+
if let Some(ref url) = lib.url {
407+
if lib.name == install_profile.install.path {
408+
lib.url = Some(format_url("maven/"));
409+
} else if !url.is_empty()
409410
&& !url.contains(
410411
"https://libraries.minecraft.net/",
411412
)
@@ -414,19 +415,19 @@ async fn fetch(
414415
&lib.name,
415416
None,
416417
vec![
417-
url,
418+
url.clone(),
418419
"https://maven.creeperhost.net/"
419420
.to_string(),
420421
maven_url.to_string(),
421422
],
422423
false,
423424
mirror_artifacts,
424425
)?;
426+
427+
lib.url = Some(format_url("maven/"));
425428
}
426429
}
427430

428-
lib.url = Some(format_url("maven/"));
429-
430431
Ok(lib)
431432
})
432433
.collect::<Result<Vec<_>, Error>>()?,
@@ -442,7 +443,7 @@ async fn fetch(
442443
// pub profile: String,
443444
// pub version: String,
444445
// pub json: String,
445-
pub path: Option<String>,
446+
// pub path: Option<String>,
446447
// pub minecraft: String,
447448
pub data: HashMap<String, daedalus::modded::SidedDataEntry>,
448449
pub libraries: Vec<daedalus::minecraft::Library>,

daedalus_client/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub fn insert_mirrored_artifact(
160160
entire_url: bool,
161161
mirror_artifacts: &DashMap<String, MirrorArtifact>,
162162
) -> Result<()> {
163-
let mut val = mirror_artifacts
163+
let val = mirror_artifacts
164164
.entry(get_path_from_artifact(artifact)?)
165165
.or_insert(MirrorArtifact {
166166
sha1,

daedalus_client/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub async fn download_file(
159159
const RETRIES: u32 = 10;
160160
for attempt in 1..=(RETRIES + 1) {
161161
let result = REQWEST_CLIENT
162-
.get(&url.replace("http://", "https://"))
162+
.get(url.replace("http://", "https://"))
163163
.send()
164164
.await
165165
.and_then(|x| x.error_for_status());

0 commit comments

Comments
 (0)