diff --git a/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ClientService.java b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ClientService.java index 6228e8ea..4bcf9e88 100644 --- a/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ClientService.java +++ b/LauncherAPI/src/main/java/pro/gravit/launcher/base/api/ClientService.java @@ -14,6 +14,19 @@ public class ClientService { public static URL[] baseURLs; public static String findLibrary(String name) { - return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(JVMHelper.NATIVE_PREFIX).concat(name).concat(JVMHelper.NATIVE_EXTENSION); + if(name == null) { + return null; + } + var needExt = !name.endsWith(JVMHelper.NATIVE_EXTENSION); + var needPrefix = !name.startsWith(JVMHelper.NATIVE_PREFIX); + if(needExt && needPrefix) { + return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(JVMHelper.NATIVE_PREFIX).concat(name).concat(JVMHelper.NATIVE_EXTENSION); + } else if(needExt) { + return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(name).concat(JVMHelper.NATIVE_EXTENSION); + } else if(needPrefix) { + return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(JVMHelper.NATIVE_PREFIX).concat(name); + } else { + return nativePath.concat(IOHelper.PLATFORM_SEPARATOR).concat(name); + } } }