Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix ClassNotFoundException when vault is missing #4151

Merged
merged 2 commits into from
May 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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