diff --git a/creator-tools/src/main/java/com/skcraft/launcher/creator/Creator.java b/creator-tools/src/main/java/com/skcraft/launcher/creator/Creator.java index 84e7f49..0573a55 100644 --- a/creator-tools/src/main/java/com/skcraft/launcher/creator/Creator.java +++ b/creator-tools/src/main/java/com/skcraft/launcher/creator/Creator.java @@ -51,6 +51,7 @@ public class Creator { } } catch (IOException e) { log.severe("Could not walk plugin directory, plugins have not been loaded"); + e.printStackTrace(); } this.plugins = pluginLoader.loadAll(); diff --git a/creator-tools/src/main/java/com/skcraft/launcher/creator/plugin/CreatorPluginLoader.java b/creator-tools/src/main/java/com/skcraft/launcher/creator/plugin/CreatorPluginLoader.java index 92c529b..0b2bc09 100644 --- a/creator-tools/src/main/java/com/skcraft/launcher/creator/plugin/CreatorPluginLoader.java +++ b/creator-tools/src/main/java/com/skcraft/launcher/creator/plugin/CreatorPluginLoader.java @@ -18,6 +18,7 @@ import java.util.List; import java.util.jar.JarFile; import java.util.stream.Collectors; import java.util.zip.ZipEntry; +import java.util.zip.ZipException; @Log public class CreatorPluginLoader extends DirectoryWalker { @@ -26,7 +27,13 @@ public class CreatorPluginLoader extends DirectoryWalker { @Override protected void onFile(File file, String relPath) throws IOException { - JarFile jarFile = new JarFile(file); + JarFile jarFile; + try { + jarFile = new JarFile(file); + } catch (ZipException e) { + log.warning(String.format("Found a non-JAR file %s in plugins directory", file)); + return; + } ZipEntry metaEntry = jarFile.getEntry("skcraftcreator.plugin.json"); if (metaEntry != null) { @@ -36,6 +43,8 @@ public class CreatorPluginLoader extends DirectoryWalker { log.info("Found plugin " + pluginInfo.getId()); candidates.add(new PluginCandidate(pluginInfo, file.toURI().toURL())); + } else { + log.warning(String.format("Found a non-plugin JAR file: %s", file)); } }