mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-18 17:15:40 -04:00
Update MinecraftDownloaderTask.java
This commit is contained in:
parent
f5d9bd5ebb
commit
c738767307
@ -341,7 +341,7 @@ public class MinecraftDownloaderTask extends AsyncTask<String, String, Throwable
|
|||||||
|
|
||||||
public static final String MINECRAFT_RES = "https://resources.download.minecraft.net/";
|
public static final String MINECRAFT_RES = "https://resources.download.minecraft.net/";
|
||||||
|
|
||||||
public JAssets downloadIndex(String versionName, File output) throws Throwable {
|
public JAssets downloadIndex(String versionName, File output) throws IOException {
|
||||||
if (!output.exists()) {
|
if (!output.exists()) {
|
||||||
output.getParentFile().mkdirs();
|
output.getParentFile().mkdirs();
|
||||||
DownloadUtils.downloadFile(verInfo.assetIndex != null ? verInfo.assetIndex.url : "https://s3.amazonaws.com/Minecraft.Download/indexes/" + versionName + ".json", output);
|
DownloadUtils.downloadFile(verInfo.assetIndex != null ? verInfo.assetIndex.url : "https://s3.amazonaws.com/Minecraft.Download/indexes/" + versionName + ".json", output);
|
||||||
@ -350,7 +350,7 @@ public class MinecraftDownloaderTask extends AsyncTask<String, String, Throwable
|
|||||||
return Tools.GLOBAL_GSON.fromJson(Tools.read(output.getAbsolutePath()), JAssets.class);
|
return Tools.GLOBAL_GSON.fromJson(Tools.read(output.getAbsolutePath()), JAssets.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void downloadAsset(JAssetInfo asset, File objectsDir) throws IOException, Throwable {
|
public void downloadAsset(JAssetInfo asset, File objectsDir) throws IOException {
|
||||||
String assetPath = asset.hash.substring(0, 2) + "/" + asset.hash;
|
String assetPath = asset.hash.substring(0, 2) + "/" + asset.hash;
|
||||||
File outFile = new File(objectsDir, assetPath);
|
File outFile = new File(objectsDir, assetPath);
|
||||||
if (!outFile.exists()) {
|
if (!outFile.exists()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user