mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 08:05:34 -04:00
Make use of the runtime selected in Per-Version config
This commit is contained in:
parent
c57fe8300f
commit
b8a25f3791
@ -130,7 +130,6 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
// FIXME: is it safe fot multi thread?
|
// FIXME: is it safe fot multi thread?
|
||||||
GLOBAL_CLIPBOARD = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
GLOBAL_CLIPBOARD = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
|
||||||
|
|
||||||
MultiRTUtils.setRuntimeNamed(this,LauncherPreferences.PREF_DEFAULT_RUNTIME);
|
|
||||||
logFile = new File(Tools.DIR_GAME_HOME, "latestlog.txt");
|
logFile = new File(Tools.DIR_GAME_HOME, "latestlog.txt");
|
||||||
logFile.delete();
|
logFile.delete();
|
||||||
logFile.createNewFile();
|
logFile.createNewFile();
|
||||||
@ -140,7 +139,16 @@ public class BaseMainActivity extends LoggableActivity {
|
|||||||
mVersionInfo = Tools.getVersionInfo(null,mProfile.selectedVersion);
|
mVersionInfo = Tools.getVersionInfo(null,mProfile.selectedVersion);
|
||||||
|
|
||||||
setTitle("Minecraft " + mProfile.selectedVersion);
|
setTitle("Minecraft " + mProfile.selectedVersion);
|
||||||
|
PerVersionConfig.VersionConfig cfg = PerVersionConfig.configMap.get(mProfile.selectedVersion);
|
||||||
|
String runtime = LauncherPreferences.PREF_DEFAULT_RUNTIME;
|
||||||
|
if(cfg != null) {
|
||||||
|
if(cfg.selectedRuntime != null) {
|
||||||
|
if(MultiRTUtils.forceReread(cfg.selectedRuntime).versionString != null) {
|
||||||
|
runtime = cfg.selectedRuntime;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MultiRTUtils.setRuntimeNamed(this,runtime);
|
||||||
// Minecraft 1.13+
|
// Minecraft 1.13+
|
||||||
isInputStackCall = mVersionInfo.arguments != null;
|
isInputStackCall = mVersionInfo.arguments != null;
|
||||||
|
|
||||||
|
@ -162,10 +162,14 @@ public class MultiRTUtils {
|
|||||||
}
|
}
|
||||||
public static void setRuntimeNamed(Context ctx, String name) throws IOException {
|
public static void setRuntimeNamed(Context ctx, String name) throws IOException {
|
||||||
File dest = new File(runtimeFolder,"/"+name);
|
File dest = new File(runtimeFolder,"/"+name);
|
||||||
if(!dest.exists()) return;
|
if((!dest.exists()) || MultiRTUtils.forceReread(name).versionString == null) throw new RuntimeException("Selected runtime is broken!");
|
||||||
Tools.DIR_HOME_JRE = dest.getAbsolutePath();
|
Tools.DIR_HOME_JRE = dest.getAbsolutePath();
|
||||||
JREUtils.relocateLibPath(ctx);
|
JREUtils.relocateLibPath(ctx);
|
||||||
}
|
}
|
||||||
|
public static Runtime forceReread(String name) {
|
||||||
|
cache.remove(name);
|
||||||
|
return read(name);
|
||||||
|
}
|
||||||
public static Runtime read(String name) {
|
public static Runtime read(String name) {
|
||||||
if(cache.containsKey(name)) return cache.get(name);
|
if(cache.containsKey(name)) return cache.get(name);
|
||||||
Runtime retur;
|
Runtime retur;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user