mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-02 22:47:41 +01:00
fix 1.8 spigot compat
This commit is contained in:
parent
aad0ee5778
commit
a869f09d43
@ -78,18 +78,24 @@ public class ProviderFactory {
|
||||
providers.put(providerClass, getProviderInstance(highestProvider));
|
||||
} else if (!nullable) {
|
||||
throw new IllegalStateException("No provider found for " + providerClass.getName());
|
||||
} else {
|
||||
essentials.getLogger().info("No provider found for " + providerClass.getSimpleName() + ", but it is nullable");
|
||||
}
|
||||
}
|
||||
registeredProviders.clear();
|
||||
}
|
||||
|
||||
private boolean testProvider(final Class<?> providerClass) throws InvocationTargetException, IllegalAccessException {
|
||||
for (final Method method : providerClass.getMethods()) {
|
||||
if (method.isAnnotationPresent(ProviderTest.class)) {
|
||||
return (Boolean) method.invoke(null);
|
||||
try {
|
||||
for (final Method method : providerClass.getMethods()) {
|
||||
if (method.isAnnotationPresent(ProviderTest.class)) {
|
||||
return (Boolean) method.invoke(null);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (final NoClassDefFoundError ignored) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private <P extends Provider> P getProviderInstance(final Class<P> provider) {
|
||||
|
@ -1,7 +1,9 @@
|
||||
package net.ess3.provider;
|
||||
|
||||
import net.essentialsx.providers.NullableProvider;
|
||||
import org.bukkit.Material;
|
||||
|
||||
@NullableProvider
|
||||
public interface MaterialTagProvider extends Provider {
|
||||
boolean tagExists(String tagName);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user