package com.blp.minotaurus.utils;

import com.blp.minotaurus.Minotaurus;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;

/**
 * @author TheJeterLP
 */
public class EconomyManager {

    private static Economy econ = null;

    public static boolean setupEconomy() {
        if (!Minotaurus.getInstance().getServer().getPluginManager().isPluginEnabled("Vault")) return false;
        RegisteredServiceProvider<Economy> rsp = Bukkit.getServicesManager().getRegistration(Economy.class);
        if (rsp == null || rsp.getProvider() == null) return false;
        econ = rsp.getProvider(); 
        return true;
    }

    public static Economy getEcon() {
        return econ;
    }
}
