Adds try around Vault hook.

https://github.com/BentoBoxWorld/BentoBox/issues/938
This commit is contained in:
tastybento 2019-09-12 13:04:27 -07:00
parent 5c1824050a
commit 65e4868641

View File

@ -23,12 +23,16 @@ public class VaultHook extends Hook {
@Override
public boolean hook() {
RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
try {
RegisteredServiceProvider<Economy> rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
economy = rsp.getProvider();
return true;
} catch (Exception e) {
return false;
}
economy = rsp.getProvider();
return true;
}
@Override