You shouldn't write a json to a jar and treat it like a jar

This commit is contained in:
Brady 2018-10-12 20:42:24 -05:00
parent 24f18f0ac2
commit df1633b2a1
No known key found for this signature in database
GPG Key ID: 73A788379A197567
1 changed files with 3 additions and 1 deletions

View File

@ -209,7 +209,9 @@ public class ProguardTask extends DefaultTask {
String version = lib.split("-")[1]; String version = lib.split("-")[1];
Path versionJar = getTemporaryFile("tempLibraries/" + lib + ".jar"); Path versionJar = getTemporaryFile("tempLibraries/" + lib + ".jar");
if (!Files.exists(versionJar)) { if (!Files.exists(versionJar)) {
write(new URL(this.versionDownloadMap.get(version)).openStream(), versionJar); JsonObject versionJson = PARSER.parse(new InputStreamReader(new URL(this.versionDownloadMap.get(version)).openStream())).getAsJsonObject();
String url = versionJson.getAsJsonObject("downloads").getAsJsonObject("client").getAsJsonPrimitive("url").getAsString();
write(new URL(url).openStream(), versionJar);
} }
continue; continue;
} }