Don't complain about plugins that does their own dependency management

Let me know if I should add your plugin to the exception list.
This commit is contained in:
Kristian S. Stangeland 2013-07-25 12:51:41 +02:00
parent 3b76fe3d99
commit 260f108749

View File

@ -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<String> DYNAMIC_DEPENDENCY = Sets.newHashSet("mcore");
/** /**
* Set of plugins that have been loaded after ProtocolLib. * Set of plugins that have been loaded after ProtocolLib.
*/ */
@ -127,10 +132,11 @@ class PluginVerifier {
public VerificationResult verify(Plugin plugin) { public VerificationResult verify(Plugin plugin) {
if (plugin == null) if (plugin == null)
throw new IllegalArgumentException("plugin cannot be NULL."); throw new IllegalArgumentException("plugin cannot be NULL.");
String name = plugin.getName();
// Skip the load order check for ProtocolLib itself // Skip the load order check for ProtocolLib itself
if (!dependency.equals(plugin)) { if (!dependency.equals(plugin)) {
if (!loadedAfter.contains(plugin.getName())) { if (!loadedAfter.contains(name) && !DYNAMIC_DEPENDENCY.contains(name)) {
if (verifyLoadOrder(dependency, plugin)) { if (verifyLoadOrder(dependency, plugin)) {
// Memorize // Memorize
loadedAfter.add(plugin.getName()); loadedAfter.add(plugin.getName());