+ public Plugin[] loadPlugins(final @NotNull File directory, final @NotNull List<File> extraPluginJars) {
+ this.pluginsDirectory = directory;
+ // Paper end
Validate.notNull(directory, "Directory cannot be null");
Validate.isTrue(directory.isDirectory(), "Directory must be a directory");
@@ -132,7 +140,11 @@ public final class SimplePluginManager implements PluginManager {
Map<String, Collection<String>> softDependencies = new HashMap<String, Collection<String>>();
// This is where it figures out all possible plugins
- for (File file : directory.listFiles()) {
+ // Paper start - extra jars
+ final List<File> pluginJars = new ArrayList<>(java.util.Arrays.asList(directory.listFiles()));
+ pluginJars.addAll(extraPluginJars);
+ for (File file : pluginJars) {
+ // Paper end
PluginLoader loader = null;
for (Pattern filter : filters) {
Matcher match = filter.matcher(file.getName());
@@ -148,14 +160,14 @@ public final class SimplePluginManager implements PluginManager {
description = loader.getPluginDescription(file);
String name = description.getName();
if (name.equalsIgnoreCase("bukkit") || name.equalsIgnoreCase("minecraft") || name.equalsIgnoreCase("mojang")) {
- server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "': Restricted Name");
+ server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + file.getParentFile().getPath() + "': Restricted Name"); // Paper
continue;
} else if (description.rawName.indexOf(' ') != -1) {
- server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "': uses the space-character (0x20) in its name");
+ server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + file.getParentFile().getPath() + "': uses the space-character (0x20) in its name"); // Paper
continue;
}
} catch (InvalidDescriptionException ex) {
- server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + directory.getPath() + "'", ex);
+ server.getLogger().log(Level.SEVERE, "Could not load '" + file.getPath() + "' in folder '" + file.getParentFile().getPath() + "'", ex); // Paper
continue;
}
@@ -166,7 +178,7 @@ public final class SimplePluginManager implements PluginManager {
description.getName(),
file.getPath(),
replacedFile.getPath(),
- directory.getPath()
+ file.getParentFile().getPath() // Paper
));
}
@@ -187,7 +199,7 @@ public final class SimplePluginManager implements PluginManager {