mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +03:00
[FEATURE] 1.17 support
This commit is contained in:
parent
32a4729970
commit
3431fae109
2 changed files with 46 additions and 2 deletions
|
@ -58,11 +58,46 @@ public static ClientProfile makeProfile(ClientProfile.Version version, String ti
|
|||
}
|
||||
OptionalFile optionalMacOs = new OptionalFile();
|
||||
optionalMacOs.name = "MacOSArgs";
|
||||
optionalMacOs.visible = false;
|
||||
optionalMacOs.actions = new ArrayList<>(1);
|
||||
optionalMacOs.actions.add(new OptionalActionJvmArgs(List.of("-XstartOnFirstThread")));
|
||||
optionalMacOs.triggers = new OptionalTrigger[]{new OptionalTrigger(OptionalTrigger.TriggerType.OS_TYPE, 2)};
|
||||
optionals.add(optionalMacOs);
|
||||
}
|
||||
if (optionContains(options, MakeProfileOption.LWJGLMAC)) {
|
||||
OptionalFile optionalMac = new OptionalFile();
|
||||
optionalMac.name = "MacLwjgl";
|
||||
optionalMac.visible = false;
|
||||
optionalMac.actions.add(new OptionalActionFile(Map.of(
|
||||
"libraries/libraries/org/lwjgl/lwjgl/3.2.1", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-glfw/3.2.1", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-openal/3.2.1", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-stb/3.2.1", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-tinyfd/3.2.1", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-opengl/3.2.1", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-jemalloc/3.2.1", ""
|
||||
)));
|
||||
optionalMac.triggers = new OptionalTrigger[]{new OptionalTrigger(OptionalTrigger.TriggerType.OS_TYPE, true, 2, 0)};
|
||||
optionals.add(optionalMac);
|
||||
OptionalFile optionalOther = new OptionalFile();
|
||||
optionalOther.name = "NonMacLwjgl";
|
||||
optionalOther.visible = false;
|
||||
optionalOther.actions.add(new OptionalActionFile(Map.of(
|
||||
"libraries/libraries/org/lwjgl/lwjgl/3.2.2", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-glfw/3.2.2", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-openal/3.2.2", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-stb/3.2.2", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-tinyfd/3.2.2", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-opengl/3.2.2", "",
|
||||
"libraries/libraries/org/lwjgl/lwjgl-jemalloc/3.2.2", ""
|
||||
)));
|
||||
optionalOther.triggers = new OptionalTrigger[]{new OptionalTrigger(OptionalTrigger.TriggerType.OS_TYPE, true, 2, 0)};
|
||||
optionals.add(optionalOther);
|
||||
}
|
||||
if (version.compareTo(ClientProfile.Version.MC117) >= 0) {
|
||||
builder.setMinJavaVersion(16);
|
||||
builder.setRecommendJavaVersion(16);
|
||||
}
|
||||
jvmArgs.add("-Dfml.ignorePatchDiscrepancies=true");
|
||||
jvmArgs.add("-Dfml.ignoreInvalidMinecraftCertificates=true");
|
||||
builder.setJvmArgs(jvmArgs);
|
||||
|
@ -80,6 +115,11 @@ public static ClientProfile makeProfile(ClientProfile.Version version, String ti
|
|||
} else {
|
||||
clientArgs.add("cpw.mods.fml.common.launcher.FMLTweaker");
|
||||
}
|
||||
if (version.compareTo(ClientProfile.Version.MC1122) <= 0) {
|
||||
builder.setMinJavaVersion(8);
|
||||
builder.setRecommendJavaVersion(8);
|
||||
builder.setMaxJavaVersion(8);
|
||||
}
|
||||
}
|
||||
}
|
||||
builder.setClientArgs(clientArgs);
|
||||
|
@ -106,6 +146,9 @@ public static MakeProfileOption[] getMakeProfileOptionsFromDir(Path dir, ClientP
|
|||
if (Files.exists(dir.resolve("liteloader.jar"))) {
|
||||
options.add(MakeProfileOption.LITELOADER);
|
||||
}
|
||||
if (Files.exists(dir.resolve("libraries/libraries/org/lwjgl/lwjgl/3.2.2")) && Files.exists(dir.resolve("libraries/libraries/org/lwjgl/lwjgl/3.2.1"))) {
|
||||
options.add(MakeProfileOption.LWJGLMAC);
|
||||
}
|
||||
if (version.compareTo(ClientProfile.Version.MC1122) <= 0) {
|
||||
options.add(MakeProfileOption.LAUNCHWRAPPER);
|
||||
}
|
||||
|
@ -187,6 +230,6 @@ public void invoke(String... args) throws Exception {
|
|||
}
|
||||
|
||||
public enum MakeProfileOption {
|
||||
LAUNCHWRAPPER, VANILLA, FORGE, FABRIC, LITELOADER
|
||||
LAUNCHWRAPPER, VANILLA, FORGE, FABRIC, LITELOADER, LWJGLMAC
|
||||
}
|
||||
}
|
||||
|
|
|
@ -488,7 +488,8 @@ public enum Version {
|
|||
MC1162("1.16.2", 751),
|
||||
MC1163("1.16.3", 753),
|
||||
MC1164("1.16.4", 754),
|
||||
MC1165("1.16.5", 754);
|
||||
MC1165("1.16.5", 754),
|
||||
MC117("1.17", 755);
|
||||
private static final Map<String, Version> VERSIONS;
|
||||
|
||||
static {
|
||||
|
|
Loading…
Reference in a new issue