mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -04:00
Fix pre-1.6 assets being downloaded EVERY TIME
This commit is contained in:
parent
73bd1cc30b
commit
081ad0d66f
@ -465,10 +465,13 @@ public class MinecraftDownloaderTask extends AsyncTask<String, String, Throwable
|
||||
JAssetInfo asset = assetsObjects.get(assetKey);
|
||||
assetsSizeBytes+=asset.size;
|
||||
String assetPath = asset.hash.substring(0, 2) + "/" + asset.hash;
|
||||
File outFile = assets.mapToResources ?new File(objectsDir,"/"+assetKey):new File(objectsDir, assetPath);
|
||||
File outFile = assets.mapToResources ?new File(outputDir,"/"+assetKey):new File(objectsDir, assetPath);
|
||||
boolean skip = outFile.exists();// skip if the file exists
|
||||
if(LauncherPreferences.PREF_CHECK_LIBRARY_SHA) //if sha checking is enabled
|
||||
if(skip) skip = Tools.compareSHA1(outFile, asset.hash); //check hash
|
||||
if(LauncherPreferences.PREF_CHECK_LIBRARY_SHA && skip){
|
||||
//if sha checking is enabled
|
||||
skip = Tools.compareSHA1(outFile, asset.hash); //check hash
|
||||
}
|
||||
|
||||
if(skip) {
|
||||
downloadedSize.addAndGet(asset.size);
|
||||
}else{
|
||||
|
Loading…
x
Reference in New Issue
Block a user