From 76fe4eed5da7ef55adeb64d122821d45bc26eeae Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 9 Sep 2024 01:41:51 -0500 Subject: [PATCH] Fix library manager attempting to load non-JAR files and folders --- .../manager/libraries/LibraryManager.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/java/dev/magicmq/pyspigot/manager/libraries/LibraryManager.java b/src/main/java/dev/magicmq/pyspigot/manager/libraries/LibraryManager.java index e33fd19..ba0aa60 100644 --- a/src/main/java/dev/magicmq/pyspigot/manager/libraries/LibraryManager.java +++ b/src/main/java/dev/magicmq/pyspigot/manager/libraries/LibraryManager.java @@ -109,15 +109,17 @@ private void initLibraries() { for (File library : toLoad) { String libName = library.getName(); - if (!libName.endsWith("-relocated.jar")) { - try { - long start = System.nanoTime(); - LoadResult result = loadLibrary(library); - long duration = System.nanoTime() - start; - if (result == LoadResult.SUCCESS) - PySpigot.get().getLogger().log(Level.INFO, "Loaded library " + libName + " in " + (duration / 1000000) + " ms"); - } catch (Throwable throwable) { - PySpigot.get().getLogger().log(Level.SEVERE, "Unable to load library " + libName + "!", throwable); + if (libName.endsWith(".jar")) { + if (!libName.endsWith("-relocated.jar")) { + try { + long start = System.nanoTime(); + LoadResult result = loadLibrary(library); + long duration = System.nanoTime() - start; + if (result == LoadResult.SUCCESS) + PySpigot.get().getLogger().log(Level.INFO, "Loaded library " + libName + " in " + (duration / 1000000) + " ms"); + } catch (Throwable throwable) { + PySpigot.get().getLogger().log(Level.SEVERE, "Unable to load library " + libName + "!", throwable); + } } } }