Paper/Spigot-API-Patches/0305-List-all-missing-hard-depends-not-just-first.patch

32 lines
1.7 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
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<String> 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);