mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 15:48:26 -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);
|
JAssetInfo asset = assetsObjects.get(assetKey);
|
||||||
assetsSizeBytes+=asset.size;
|
assetsSizeBytes+=asset.size;
|
||||||
String assetPath = asset.hash.substring(0, 2) + "/" + asset.hash;
|
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
|
boolean skip = outFile.exists();// skip if the file exists
|
||||||
if(LauncherPreferences.PREF_CHECK_LIBRARY_SHA) //if sha checking is enabled
|
if(LauncherPreferences.PREF_CHECK_LIBRARY_SHA && skip){
|
||||||
if(skip) skip = Tools.compareSHA1(outFile, asset.hash); //check hash
|
//if sha checking is enabled
|
||||||
|
skip = Tools.compareSHA1(outFile, asset.hash); //check hash
|
||||||
|
}
|
||||||
|
|
||||||
if(skip) {
|
if(skip) {
|
||||||
downloadedSize.addAndGet(asset.size);
|
downloadedSize.addAndGet(asset.size);
|
||||||
}else{
|
}else{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user