mirror of
https://github.com/2009scape/2009Scape-mobile.git
synced 2025-12-21 09:01:56 -07:00
Use the version ID from extra to run the game
Fixes the issue where forge 1.17+ would not get some of its libraries loaded
This commit is contained in:
parent
f5a96bdba5
commit
ef36c96edc
2 changed files with 9 additions and 11 deletions
|
|
@ -71,7 +71,7 @@ public class MainActivity extends BaseActivity {
|
||||||
public ArrayAdapter<String> ingameControlsEditorArrayAdapter;
|
public ArrayAdapter<String> ingameControlsEditorArrayAdapter;
|
||||||
public AdapterView.OnItemClickListener ingameControlsEditorListener;
|
public AdapterView.OnItemClickListener ingameControlsEditorListener;
|
||||||
|
|
||||||
protected volatile JMinecraftVersionList.Version mVersionInfo;
|
protected volatile String mVersionId;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
|
@ -147,8 +147,8 @@ public class MainActivity extends BaseActivity {
|
||||||
String version = getIntent().getStringExtra(INTENT_MINECRAFT_VERSION);
|
String version = getIntent().getStringExtra(INTENT_MINECRAFT_VERSION);
|
||||||
version = version == null ? minecraftProfile.lastVersionId : version;
|
version = version == null ? minecraftProfile.lastVersionId : version;
|
||||||
|
|
||||||
mVersionInfo = Tools.getVersionInfo(version);
|
mVersionId = version;
|
||||||
isInputStackCall = mVersionInfo.arguments != null;
|
isInputStackCall = Tools.getVersionInfo(mVersionId).arguments != null;
|
||||||
|
|
||||||
Tools.getDisplayMetrics(this);
|
Tools.getDisplayMetrics(this);
|
||||||
windowWidth = Tools.getDisplayFriendlyRes(currentDisplayMetrics.widthPixels, scaleFactor);
|
windowWidth = Tools.getDisplayFriendlyRes(currentDisplayMetrics.widthPixels, scaleFactor);
|
||||||
|
|
@ -326,15 +326,13 @@ public class MainActivity extends BaseActivity {
|
||||||
checkJavaArgsIsLaunchable(JREUtils.jreReleaseList.get("JAVA_VERSION"));
|
checkJavaArgsIsLaunchable(JREUtils.jreReleaseList.get("JAVA_VERSION"));
|
||||||
// appendlnToLog("Info: Custom Java arguments: \"" + LauncherPreferences.PREF_CUSTOM_JAVA_ARGS + "\"");
|
// appendlnToLog("Info: Custom Java arguments: \"" + LauncherPreferences.PREF_CUSTOM_JAVA_ARGS + "\"");
|
||||||
|
|
||||||
Logger.getInstance().appendToLog("Info: Selected Minecraft version: " + mVersionInfo.id +
|
Logger.getInstance().appendToLog("Info: Selected Minecraft version: " + mVersionId);
|
||||||
((mVersionInfo.inheritsFrom == null || mVersionInfo.inheritsFrom.equals(mVersionInfo.id)) ?
|
|
||||||
"" : " (" + mVersionInfo.inheritsFrom + ")"));
|
|
||||||
|
|
||||||
|
|
||||||
JREUtils.redirectAndPrintJRELog();
|
JREUtils.redirectAndPrintJRELog();
|
||||||
|
|
||||||
LauncherProfiles.update();
|
LauncherProfiles.update();
|
||||||
Tools.launchMinecraft(this, mProfile, minecraftProfile, mVersionInfo);
|
Tools.launchMinecraft(this, mProfile, minecraftProfile, mVersionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkJavaArgsIsLaunchable(String jreVersion) throws Throwable {
|
private void checkJavaArgsIsLaunchable(String jreVersion) throws Throwable {
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ public final class Tools {
|
||||||
|
|
||||||
|
|
||||||
public static void launchMinecraft(final Activity activity, MinecraftAccount minecraftAccount,
|
public static void launchMinecraft(final Activity activity, MinecraftAccount minecraftAccount,
|
||||||
MinecraftProfile minecraftProfile, JMinecraftVersionList.Version versionInfo) throws Throwable {
|
MinecraftProfile minecraftProfile, String versionId) throws Throwable {
|
||||||
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
|
||||||
((ActivityManager)activity.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryInfo(mi);
|
((ActivityManager)activity.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryInfo(mi);
|
||||||
if(LauncherPreferences.PREF_RAM_ALLOCATION > (mi.availMem/1048576L)) {
|
if(LauncherPreferences.PREF_RAM_ALLOCATION > (mi.availMem/1048576L)) {
|
||||||
|
|
@ -127,7 +127,7 @@ public final class Tools {
|
||||||
memoryErrorLock.wait();
|
memoryErrorLock.wait();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
JMinecraftVersionList.Version versionInfo = Tools.getVersionInfo(versionId);
|
||||||
LauncherProfiles.update();
|
LauncherProfiles.update();
|
||||||
String gamedirPath = Tools.getGameDirPath(minecraftProfile);
|
String gamedirPath = Tools.getGameDirPath(minecraftProfile);
|
||||||
|
|
||||||
|
|
@ -142,7 +142,7 @@ public final class Tools {
|
||||||
OldVersionsUtils.selectOpenGlVersion(versionInfo);
|
OldVersionsUtils.selectOpenGlVersion(versionInfo);
|
||||||
|
|
||||||
|
|
||||||
String launchClassPath = generateLaunchClassPath(versionInfo, versionInfo.id);
|
String launchClassPath = generateLaunchClassPath(versionInfo, versionId);
|
||||||
|
|
||||||
List<String> javaArgList = new ArrayList<String>();
|
List<String> javaArgList = new ArrayList<String>();
|
||||||
|
|
||||||
|
|
@ -168,7 +168,7 @@ public final class Tools {
|
||||||
}
|
}
|
||||||
javaArgList.add("-Dlog4j.configurationFile=" + configFile);
|
javaArgList.add("-Dlog4j.configurationFile=" + configFile);
|
||||||
}
|
}
|
||||||
javaArgList.addAll(Arrays.asList(getMinecraftJVMArgs(versionInfo.id, gamedirPath)));
|
javaArgList.addAll(Arrays.asList(getMinecraftJVMArgs(versionId, gamedirPath)));
|
||||||
javaArgList.add("-cp");
|
javaArgList.add("-cp");
|
||||||
javaArgList.add(getLWJGL3ClassPath() + ":" + launchClassPath);
|
javaArgList.add(getLWJGL3ClassPath() + ":" + launchClassPath);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue