fix: IllegalAccessError on Java 16

This commit is contained in:
Glavo 2021-05-16 21:22:20 +08:00 committed by Yuhui Huang
parent 20148d0b02
commit a53d2a1370
2 changed files with 4 additions and 0 deletions

View File

@ -130,6 +130,9 @@ public class DefaultLauncher extends Launcher {
if (options.getMinMemory() != null && options.getMinMemory() > 0)
res.add("-Xms" + options.getMinMemory() + "m");
if (options.getJava().getParsedVersion() >= JavaVersion.JAVA_16)
res.add("--illegal-access=permit");
res.add("-Dfml.ignoreInvalidMinecraftCertificates=true");
res.add("-Dfml.ignorePatchDiscrepancies=true");
}

View File

@ -96,6 +96,7 @@ public final class JavaVersion {
public static final int JAVA_7 = 7;
public static final int JAVA_8 = 8;
public static final int JAVA_9 = 9;
public static final int JAVA_16 = 16;
private static int parseVersion(String version) {
Matcher matcher = VERSION.matcher(version);