Skip to content

Commit

Permalink
Fix ClassNotFoundException when vault is missing (#4151)
Browse files Browse the repository at this point in the history
  • Loading branch information
JRoy authored May 14, 2021
1 parent c9310ea commit 02193b0
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,13 @@ public void setupForTesting(final Server server) throws IOException, InvalidDesc

@Override
public void onLoad() {
// Vault registers their Essentials provider at low priority, so we have to use normal priority here
getServer().getServicesManager().register(net.milkbowl.vault.economy.Economy.class, new VaultEconomyProvider(this), this, ServicePriority.Normal);
try {
// Vault registers their Essentials provider at low priority, so we have to use normal priority here
Class.forName("net.milkbowl.vault.economy.Economy");
getServer().getServicesManager().register(net.milkbowl.vault.economy.Economy.class, new VaultEconomyProvider(this), this, ServicePriority.Normal);
} catch (final ClassNotFoundException ignored) {
// Probably safer than fetching for the plugin as bukkit may not have marked it as enabled at this point in time
}
}

@Override
Expand Down

0 comments on commit 02193b0

Please # to comment.