[FIX] Possible problem with lwjgl

This commit is contained in:
Gravit'a 2024-03-10 15:49:01 +07:00
parent e72e4ebb92
commit 5c7f7eedec

View file

@ -14,6 +14,19 @@ public class ClientService {
public static URL[] baseURLs; public static URL[] baseURLs;
public static String findLibrary(String name) { public static String findLibrary(String name) {
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); 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);
}
} }
} }