1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-03 13:27:23 +01:00

Fix LegacyPluginLoader dependency registration ()

This commit is contained in:
Owen1212055 2023-04-22 21:55:10 -04:00
parent 2da0966452
commit a4b55ff96a

View file

@ -1867,6 +1867,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return this.dependencies.contains(pluginIdentifier);
+ }
+
+ // Used by the legacy loader -- this isn't recommended
+ public void addDirectDependency(String dependency) {
+ this.dependencies.add(dependency);
+ }
+
+ @Override
+ public String toString() {
+ return "ProviderDependencyTree{" +
@ -2292,6 +2297,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ PluginMeta configuration = provider.getMeta();
+
+ PluginProvider<T> replacedProvider = providersToLoad.put(configuration.getName(), provider);
+ dependencyTree.addDirectDependency(configuration.getName()); // add to dependency tree
+ if (replacedProvider != null) {
+ LOGGER.severe(String.format(
+ "Ambiguous plugin name `%s' for files `%s' and `%s' in `%s'",
@ -2324,6 +2330,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ ));
+ } else {
+ String replacedPlugin = pluginsProvided.put(provided, configuration.getName());
+ dependencyTree.addDirectDependency(provided); // add to dependency tree
+ if (replacedPlugin != null) {
+ LOGGER.warning(String.format(
+ "`%s' is provided by both `%s' and `%s'",