List all missing hard depends not just first (#5673)

This commit is contained in:
Jake Potrebic 2021-05-20 22:33:41 -07:00
parent c8fec2dde2
commit ca3326ac87

View file

@ -0,0 +1,31 @@
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -0,0 +0,0 @@ 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);