- Added a check to prevent attempt to launch 1.17+ with Java 8.
- Added an option to disable gl4es shaderconv in order to let ANGLE
processes them directly. This option lets Minecraft 1.17+ work
without the patch resource pack, OptiFine works aswell :)
- Changing renderer library no longer requires restart the launcher.
- Fixed some alert dialogs not displaying.
- PList default values are now set every time it loads.
This commit is contained in:
Duy Tran Khanh committed 2021-08-13 07:25:17 +07:00
1 parent a819225ee2
commit fe5f9e77a9
26 files changed
+116 -129

No files matched your search

@@ -21,6 +21,7 @@ public class JMinecraftVersionList {
public Map<String, MinecraftClientInfo> downloads;
public String id;
public String inheritsFrom;
public JavaVersionInfo javaVersion;
public DependentLibrary[] libraries;
public String mainClass;
public String minecraftArguments;
@@ -31,7 +32,10 @@ public class JMinecraftVersionList {
public String type;
public String url;
}
public static class JavaVersionInfo {
public String component;
public int majorVersion;
}
// Since 1.13
public static class Arguments {
public Object[] game;
@@ -79,6 +79,18 @@ public final class Tools
public static final String LIBNAME_OPTIFINE = "optifine:OptiFine";
public static void launchMinecraft(MinecraftAccount profile, final JMinecraftVersionList.Version versionInfo) throws Throwable {
String javaVersion = System.getProperty("java.version");
if (javaVersion.startsWith("1.")) {
javaVersion = javaVersion.substring(2);
}
int dotIndex = javaVersion.indexOf('.');
if (dotIndex != -1) {
javaVersion = javaVersion.substring(0, dotIndex);
}
if (versionInfo.javaVersion != null && versionInfo.javaVersion.majorVersion > Integer.parseInt(javaVersion)) {
throw new UnsupportedOperationException("Minecraft " + versionInfo.id + " requires Java " + versionInfo.javaVersion.majorVersion + " in order to run. Please switch to Java " + versionInfo.javaVersion.majorVersion + " in launcher settings.");
}
String[] launchArgs = getMinecraftArgs(profile, versionInfo);
// ctx.appendlnToLog("Minecraft Args: " + Arrays.toString(launchArgs));
@@ -89,12 +89,14 @@ public class UIKit {
PLaunchApp.installMinecraft(versionPath);
}
public static void callback_SurfaceViewController_launchMinecraft(int width, int height) {
public static void callback_SurfaceViewController_launchMinecraft(int width, int height, String rendererLibName) {
MCOptionUtils.load();
MCOptionUtils.set("overrideWidth", Integer.toString(width));
MCOptionUtils.set("overrideHeight", Integer.toString(height));
MCOptionUtils.save();
System.setProperty("cacio.managed.screensize", width + "x" + height);
System.setProperty("org.lwjgl.opengl.libname", rendererLibName);
GLFW.internalChangeMonitorSize(width, height);
CallbackBridge.mouseX = width / 2;