mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-17 00:29:50 -04:00
Fix versions that are not downloaded yet
This commit is contained in:
parent
765b504c5f
commit
4a6eea08fc
@ -132,7 +132,7 @@ public class LauncherActivity extends BaseActivity {
|
||||
return false;
|
||||
}
|
||||
String normalizedVersionId = AsyncMinecraftDownloader.normalizeVersionId(prof.lastVersionId);
|
||||
JMinecraftVersionList.Version mcVersion = Tools.getVersionInfo(normalizedVersionId);
|
||||
JMinecraftVersionList.Version mcVersion = AsyncMinecraftDownloader.getListedVersion(normalizedVersionId);
|
||||
new AsyncMinecraftDownloader(this, mcVersion, normalizedVersionId, () -> runOnUiThread(() -> {
|
||||
try {
|
||||
Intent mainIntent = new Intent(getBaseContext(), MainActivity.class);
|
||||
|
@ -62,7 +62,7 @@ public class AsyncMinecraftDownloader {
|
||||
try {
|
||||
File verJsonDir = new File(Tools.DIR_HOME_VERSION + downVName + ".json");
|
||||
|
||||
if (verInfo.url != null) {
|
||||
if (verInfo != null && verInfo.url != null) {
|
||||
if(!LauncherPreferences.PREF_CHECK_LIBRARY_SHA) Log.w("Chk","Checker is off");
|
||||
|
||||
boolean isManifestGood = verJsonDir.exists()
|
||||
@ -80,7 +80,7 @@ public class AsyncMinecraftDownloader {
|
||||
}
|
||||
}
|
||||
|
||||
verInfo = Tools.getVersionInfo(verInfo.id);
|
||||
verInfo = Tools.getVersionInfo(versionName);
|
||||
|
||||
// THIS one function need the activity in the case of an error
|
||||
if(!JRE17Util.installNewJreIfNeeded(activity, verInfo)){
|
||||
@ -358,6 +358,15 @@ public class AsyncMinecraftDownloader {
|
||||
return versionString;
|
||||
}
|
||||
|
||||
public static JMinecraftVersionList.Version getListedVersion(String normalizedVersionString) {
|
||||
JMinecraftVersionList versionList = (JMinecraftVersionList) ExtraCore.getValue(ExtraConstants.RELEASE_TABLE);
|
||||
for(JMinecraftVersionList.Version version : versionList.versions) {
|
||||
if(version.id.equals(normalizedVersionString)) return version;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**@return A byte buffer bound to a thread, useful to recycle it across downloads */
|
||||
private byte[] getByteBuffer(){
|
||||
byte[] buffer = mThreadBuffers.get(Thread.currentThread());
|
||||
|
Loading…
x
Reference in New Issue
Block a user