If vault throws an exception, it should not be enabled.

This commit is contained in:
KHobbits 2012-01-20 23:04:43 +00:00
parent f5d65371b2
commit 766935871f

View File

@ -121,8 +121,15 @@ public class VaultEco implements Method
@Override @Override
public boolean isCompatible(Plugin plugin) public boolean isCompatible(Plugin plugin)
{ {
RegisteredServiceProvider<Economy> ecoPlugin = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); try
return plugin instanceof Vault && ecoPlugin != null && !ecoPlugin.getProvider().getName().equals("Essentials Economy"); {
RegisteredServiceProvider<Economy> ecoPlugin = plugin.getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
return plugin instanceof Vault && ecoPlugin != null && !ecoPlugin.getProvider().getName().equals("Essentials Economy");
}
catch (Exception e)
{
return false;
}
} }
@Override @Override