From 260f1087492e667bf44c05448ce3912c6e513a02 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Thu, 25 Jul 2013 12:51:41 +0200 Subject: [PATCH] Don't complain about plugins that does their own dependency management Let me know if I should add your plugin to the exception list. --- .../com/comphenix/protocol/injector/PluginVerifier.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PluginVerifier.java b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PluginVerifier.java index 30bf4e51..26d8ed52 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PluginVerifier.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/injector/PluginVerifier.java @@ -51,6 +51,11 @@ class PluginVerifier { } } + /** + * Contains a list of plugins that will detect and use ProtocolLib dynamically, instead of relying on the dependency system. + */ + private static final Set DYNAMIC_DEPENDENCY = Sets.newHashSet("mcore"); + /** * Set of plugins that have been loaded after ProtocolLib. */ @@ -127,10 +132,11 @@ class PluginVerifier { public VerificationResult verify(Plugin plugin) { if (plugin == null) throw new IllegalArgumentException("plugin cannot be NULL."); + String name = plugin.getName(); // Skip the load order check for ProtocolLib itself if (!dependency.equals(plugin)) { - if (!loadedAfter.contains(plugin.getName())) { + if (!loadedAfter.contains(name) && !DYNAMIC_DEPENDENCY.contains(name)) { if (verifyLoadOrder(dependency, plugin)) { // Memorize loadedAfter.add(plugin.getName());