From dab6ec6cdfb29a82e770eb18d6fa0507d5a3cc2f Mon Sep 17 00:00:00 2001 From: Jake Potrebic <15055071+Machine-Maker@users.noreply.github.com> Date: Thu, 20 May 2021 22:33:41 -0700 Subject: [PATCH] List all missing hard depends not just first (#5673) --- ...-missing-hard-depends-not-just-first.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Spigot-API-Patches/0305-List-all-missing-hard-depends-not-just-first.patch diff --git a/Spigot-API-Patches/0305-List-all-missing-hard-depends-not-just-first.patch b/Spigot-API-Patches/0305-List-all-missing-hard-depends-not-just-first.patch new file mode 100644 index 000000000..85cf5bd18 --- /dev/null +++ b/Spigot-API-Patches/0305-List-all-missing-hard-depends-not-just-first.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jake Potrebic +Date: Tue, 18 May 2021 10:38:10 -0700 +Subject: [PATCH] List all missing hard depends not just first + + +diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +index d3812d8cd195017841ee08ffbc53a5748fcc74ec..c2070d2df2349f6215250f0d24319befafbcf472 100644 +--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java ++++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java +@@ -132,13 +132,19 @@ public final class JavaPluginLoader implements PluginLoader { + )); + } + ++ Set missingHardDependencies = new HashSet<>(description.getDepend().size()); // Paper - list all missing hard depends + for (final String pluginName : description.getDepend()) { + Plugin current = server.getPluginManager().getPlugin(pluginName); + + if (current == null) { +- throw new UnknownDependencyException("Unknown dependency " + pluginName + ". Please download and install " + pluginName + " to run this plugin."); ++ missingHardDependencies.add(pluginName); // Paper - list all missing hard depends + } + } ++ // Paper start - list all missing hard depends ++ if (!missingHardDependencies.isEmpty()) { ++ throw new UnknownDependencyException("Unknown dependencies: " + String.join(", ", missingHardDependencies) + " Please download and install these plugins to run this plugin."); ++ } ++ // Paper end + + server.getUnsafe().checkSupported(description); +