diff --git a/JavaApp/src/main/java/net/kdt/pojavlaunch/uikit/UIKit.java b/JavaApp/src/main/java/net/kdt/pojavlaunch/uikit/UIKit.java index 25873c51..2b8c3f87 100644 --- a/JavaApp/src/main/java/net/kdt/pojavlaunch/uikit/UIKit.java +++ b/JavaApp/src/main/java/net/kdt/pojavlaunch/uikit/UIKit.java @@ -81,7 +81,7 @@ public class UIKit { PojavClassLoader loader = (PojavClassLoader) ClassLoader.getSystemClassLoader(); loader.addURL(new File(filepath).toURI().toURL()); - // LabyMod Installer uses FlatLAF which has some macOS-specific codes, so we make it thinks it's running on Linux. + // LabyMod Installer uses FlatLAF which has some macOS-specific codes, so we make it think it's running on Linux. patch_FlatLAF_setLinux(); Class clazz = loader.loadClass(mainClass); diff --git a/Natives/MinecraftResourceUtils.m b/Natives/MinecraftResourceUtils.m index f25c3961..06a50ad6 100644 --- a/Natives/MinecraftResourceUtils.m +++ b/Natives/MinecraftResourceUtils.m @@ -273,6 +273,19 @@ static AFURLSessionManager* manager; // Exclude LWJGL libraries [library[@"name"] hasPrefix:@"org.lwjgl"] ); + + if ([library[@"name"] hasPrefix:@"net.java.dev.jna:jna:"]) { + // Special handling for LabyMod 1.8.9 and Forge 1.12.2(?) + // we have libjnidispatch 5.8.0 in Frameworks directory + NSString *versionStr = [library[@"name"] componentsSeparatedByString:@":"][2]; + NSArray *version = [versionStr componentsSeparatedByString:@"."]; + if (version[0].intValue < 5 || version[1].intValue < 8) { + //System.out.println("Library " + libItem.name + " has been changed to version 5.8.0"); + library[@"name"] = @"net.java.dev.jna:jna:5.8.0"; + library[@"downloads"][@"artifact"][@"path"] = @"net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar"; + library[@"downloads"][@"artifact"][@"url"] = @"https://libraries.minecraft.net/net/java/dev/jna/jna/5.8.0/jna-5.8.0.jar"; + } + } } // Add the client as a library @@ -386,7 +399,7 @@ static AFURLSessionManager* manager; /* Special case for 1.19+ * Since 1.19-pre1, setting the window icon on macOS goes through ObjC. - * However, if an IOException occurrs, it won't try to set. + * However, if an IOException occurs, it won't try to set. * We skip downloading the icon file to trigger this. */ if ([name hasSuffix:@"icons/minecraft.icns"]) { [NSFileManager.defaultManager removeItemAtPath:pathname error:nil];