Skip to content

Commit

Permalink
Fix loader ordering (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geometrically committed Jul 28, 2023
1 parent 0d56127 commit 10e7b66
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
9 changes: 2 additions & 7 deletions daedalus_client/src/fabric.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,13 @@ pub async fn retrieve_data(
version.loaders.sort_by(|x, y| {
list.loader
.iter()
.position(|z| {
x.id.split('-').next().unwrap_or_default() == &*z.version
})
.position(|z| x.id == *z.version)
.unwrap_or_default()
.cmp(
&list
.loader
.iter()
.position(|z| {
y.id.split('-').next().unwrap_or_default()
== z.version
})
.position(|z| y.id == z.version)
.unwrap_or_default(),
)
})
Expand Down
6 changes: 2 additions & 4 deletions daedalus_client/src/minecraft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use crate::download_file;
use crate::{format_url, upload_file_to_bucket, Error};
use daedalus::get_hash;
use daedalus::minecraft::{
merge_partial_library, Library, PartialLibrary,
VersionManifest,
merge_partial_library, Library, PartialLibrary, VersionManifest,
};
use log::info;
use serde::Deserialize;
Expand Down Expand Up @@ -115,8 +114,7 @@ pub async fn retrieve_data(

let mut new_libraries = Vec::new();
for library in version_info.libraries.clone() {
let mut libs =
patch_library(&patches, library);
let mut libs = patch_library(&patches, library);
new_libraries.append(&mut libs)
}
version_info.libraries = new_libraries;
Expand Down
9 changes: 2 additions & 7 deletions daedalus_client/src/quilt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,18 +259,13 @@ pub async fn retrieve_data(
version.loaders.sort_by(|x, y| {
list.loader
.iter()
.position(|z| {
x.id.split('-').next().unwrap_or_default() == &*z.version
})
.position(|z| x.id == *z.version)
.unwrap_or_default()
.cmp(
&list
.loader
.iter()
.position(|z| {
y.id.split('-').next().unwrap_or_default()
== z.version
})
.position(|z| y.id == z.version)
.unwrap_or_default(),
)
})
Expand Down

0 comments on commit 10e7b66

Please sign in to comment.