Skip to content

Commit

Permalink
Fix launcher overrides (#7)
Browse files Browse the repository at this point in the history
* Fix launcher overrides

* Remove none set

* Patch to work with legacy versions

* remove mc
  • Loading branch information
Geometrically committed May 13, 2023
1 parent 6512dba commit 3db0053
Show file tree
Hide file tree
Showing 5 changed files with 2,068 additions and 25 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.1.20"
version = "0.1.21"
authors = ["Jai A <[email protected]>"]
edition = "2018"
license = "MIT"
Expand Down
33 changes: 30 additions & 3 deletions daedalus/src/minecraft.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,22 @@ pub fn merge_partial_library(
mut merge: Library,
) -> Library {
if let Some(downloads) = partial.downloads {
merge.downloads = Some(downloads)
if let Some(merge_downloads) = &mut merge.downloads {
if let Some(artifact) = downloads.artifact {
merge_downloads.artifact = Some(artifact);
}
if let Some(classifiers) = downloads.classifiers {
if let Some(merge_classifiers) = &mut merge_downloads.classifiers {
for classifier in classifiers {
merge_classifiers.insert(classifier.0, classifier.1);
}
} else {
merge_downloads.classifiers = Some(classifiers);
}
}
} else {
merge.downloads = Some(downloads)
}
}
if let Some(extract) = partial.extract {
merge.extract = Some(extract)
Expand All @@ -339,10 +354,22 @@ pub fn merge_partial_library(
merge.url = Some(url)
}
if let Some(natives) = partial.natives {
merge.natives = Some(natives)
if let Some(merge_natives) = &mut merge.natives {
for native in natives {
merge_natives.insert(native.0, native.1);
}
} else {
merge.natives = Some(natives);
}
}
if let Some(rules) = partial.rules {
merge.rules = Some(rules)
if let Some(merge_rules) = &mut merge.rules {
for rule in rules {
merge_rules.push(rule);
}
} else {
merge.rules = Some(rules)
}
}
if let Some(checksums) = partial.checksums {
merge.checksums = Some(checksums)
Expand Down
2 changes: 1 addition & 1 deletion daedalus_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "daedalus_client"
version = "0.1.20"
version = "0.1.21"
authors = ["Jai A <[email protected]>"]
edition = "2018"

Expand Down
Loading

0 comments on commit 3db0053

Please sign in to comment.