Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Fix text2speech being downloaded twice on macOS
Browse files Browse the repository at this point in the history
Other operating systems (linux/windows) have natives for text2speech but macOS
doesn't, so it does an extra download... so we were accidentally downloading
it twice!
  • Loading branch information
comp500 committed Oct 27, 2020
1 parent 5eccfd7 commit 26fc4f7
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,17 @@ public MetadataResolutionResult resolve(MetadataCacheHelper.MetadataCacheView ca

JsonObject downloadsObj = libObj.getAsJsonObject("downloads");
JsonObject nativesObj = libObj.getAsJsonObject("natives");
if (nativesObj != null && nativesObj.has(currentOS)) {
if (nativesObj != null && nativesObj.size() > 0) {
// TODO: should natives be ignored anyway? - we don't/can't handle them properly (see wiki)
String nativesClassifier = nativesObj.get(currentOS).getAsString();
JsonObject nativesDownloadObj = downloadsObj.getAsJsonObject("classifiers").getAsJsonObject(nativesClassifier);
if (nativesDownloadObj == null) {
throw new RuntimeException("No natives available in " + downloadsObj + " classifier " + nativesClassifier);
if (nativesObj.has(currentOS)) {
String nativesClassifier = nativesObj.get(currentOS).getAsString();
JsonObject nativesDownloadObj = downloadsObj.getAsJsonObject("classifiers").getAsJsonObject(nativesClassifier);
if (nativesDownloadObj == null) {
throw new RuntimeException("No natives available in " + downloadsObj + " classifier " + nativesClassifier);
}
newMetadata.libs.add(new MinecraftLibraryJar(libObj.get("name").getAsString() + ":" + nativesClassifier,
new URL(nativesDownloadObj.get("url").getAsString()), nativesDownloadObj.get("sha1").getAsString()));
}
newMetadata.libs.add(new MinecraftLibraryJar(libObj.get("name").getAsString() + ":" + nativesClassifier,
new URL(nativesDownloadObj.get("url").getAsString()), nativesDownloadObj.get("sha1").getAsString()));
continue;
}

Expand Down

0 comments on commit 26fc4f7

Please sign in to comment.