Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ public static Map<String, Object> getData(File librariesDir) {

public static boolean install(File libraryDir, File minecraftJar, File installerJar) throws Throwable {
ProgressCallback monitor = ProgressCallback.withOutputs(System.out);
if (System.getProperty("java.net.preferIPv4Stack") == null) {
boolean preferIpv4StackUnset = System.getProperty("java.net.preferIPv4Stack") == null;
if (preferIpv4StackUnset) {
System.setProperty("java.net.preferIPv4Stack", "true");
}
String vendor = System.getProperty("java.vendor", "missing vendor");
Expand All @@ -55,6 +56,9 @@ public static boolean install(File libraryDir, File minecraftJar, File installer
// MinecraftForge has removed all old installers since 2024/2/27, but they still exist in NeoForge.
PostProcessors processors = new PostProcessors(wrapper, true, monitor);
Method processMethod = PostProcessors.class.getMethod("process", File.class, File.class, File.class, File.class);
if (preferIpv4StackUnset) {
System.clearProperty("java.net.preferIPv4Stack");
}
if (boolean.class.equals(processMethod.getReturnType())) {
return (boolean) processMethod.invoke(processors, libraryDir, minecraftJar, libraryDir.getParentFile(), installerJar);
} else {
Expand Down