Skip to content

Commit

Permalink
Fix Fabric Loader 0.16.0, old forge versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Aug 22, 2024
1 parent 1f8d569 commit 679ffbc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion daedalus/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "daedalus"
version = "0.2.2"
version = "0.2.3"
authors = ["Jai A <[email protected]>"]
edition = "2021"
license = "MIT"
Expand Down
27 changes: 23 additions & 4 deletions daedalus/src/modded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,27 @@ pub fn merge_partial_version(
) -> VersionInfo {
let merge_id = merge.id.clone();

let mut libraries = vec![];

// We skip duplicate libraries that exist already in the partial version
for mut lib in merge.libraries {
let lib_artifact = lib.name.rsplit_once(':').map(|x| x.0);

if let Some(lib_artifact) = lib_artifact {
if !partial.libraries.iter().any(|x| {
let target_artifact = x.name.rsplit_once(':').map(|x| x.0);

target_artifact == Some(lib_artifact) && x.include_in_classpath
}) {
libraries.push(lib);
} else {
lib.include_in_classpath = false;
}
} else {
libraries.push(lib);
}
}

VersionInfo {
arguments: if let Some(partial_args) = partial.arguments {
if let Some(merge_args) = merge.arguments {
Expand Down Expand Up @@ -133,10 +154,8 @@ pub fn merge_partial_version(
downloads: merge.downloads,
id: partial.id.replace(DUMMY_REPLACE_STRING, &merge_id),
java_version: merge.java_version,
libraries: partial
.libraries
.into_iter()
.chain(merge.libraries)
libraries: libraries.into_iter()
.chain(partial.libraries)
.map(|mut x| {
x.name = x.name.replace(DUMMY_REPLACE_STRING, &merge_id);

Expand Down
1 change: 1 addition & 0 deletions daedalus_client/src/fabric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub async fn fetch_quilt(
.await
}

#[allow(clippy::too_many_arguments)]
#[tracing::instrument(skip(semaphore, upload_files, mirror_artifacts))]
async fn fetch(
format_version: usize,
Expand Down

0 comments on commit 679ffbc

Please sign in to comment.