diff --git a/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java b/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java index f580da7..8f26935 100644 --- a/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java +++ b/src/main/java/net/knarcraft/bookswithoutborders/utility/EconomyHelper.java @@ -6,11 +6,19 @@ import org.bukkit.Server; import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.RegisteredServiceProvider; +import org.bukkit.plugin.ServicesManager; -public class EconomyHelper { +/** + * Helper class for economy related functions + */ +public final class EconomyHelper { private static Economy economy; + private EconomyHelper() { + + } + /** * Gets an economy instance for making transactions * @return

An economy instance, or null if it's not initialized

@@ -30,9 +38,10 @@ public class EconomyHelper { Server server = BooksWithoutBorders.getInstance().getServer(); Plugin plugin = server.getPluginManager().getPlugin("Vault"); + ServicesManager servicesManager = server.getServicesManager(); if (plugin != null) { - RegisteredServiceProvider economyProvider = server.getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class); + RegisteredServiceProvider economyProvider = servicesManager.getRegistration(Economy.class); if (economyProvider != null) { economy = economyProvider.getProvider(); }