diff --git a/chunky/src/java/se/llbit/chunky/main/Chunky.java b/chunky/src/java/se/llbit/chunky/main/Chunky.java index e95590407..63de8da21 100644 --- a/chunky/src/java/se/llbit/chunky/main/Chunky.java +++ b/chunky/src/java/se/llbit/chunky/main/Chunky.java @@ -272,7 +272,7 @@ private void loadPlugins() { .filter(jarName -> !jarName.isEmpty()) .map(jarName -> pluginsPath.resolve(jarName).toAbsolutePath().toFile()) .map(PluginManager::parsePluginManifest) - .flatMap(o -> o.map(Stream::of).orElseGet(Stream::empty)) // replace with Optional::stream in java9+ + .flatMap(Optional::stream) .collect(Collectors.toSet()); // Load plugins diff --git a/chunky/src/java/se/llbit/chunky/plugin/loader/JarPluginLoader.java b/chunky/src/java/se/llbit/chunky/plugin/loader/JarPluginLoader.java index 1fe45de5a..50d76e8a8 100644 --- a/chunky/src/java/se/llbit/chunky/plugin/loader/JarPluginLoader.java +++ b/chunky/src/java/se/llbit/chunky/plugin/loader/JarPluginLoader.java @@ -23,7 +23,7 @@ public void load(BiConsumer onLoad, PluginManifest plugi } catch (IOException | ClassNotFoundException e) { Log.error("Could not load the plugin", e); } catch (ClassCastException e) { - Log.error("Plugin main class has wrong type", e); + Log.error("Plugin main class has wrong type (must implement se.llbit.chunky.Plugin)", e); } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { Log.error("Could not create plugin instance", e); }