Search in sources :

Example 1 with VaultEconomy

use of com.gamingmesh.jobs.economy.VaultEconomy in project Jobs by GamingMesh.

the class HookEconomyTask method run.

public void run() {
    Plugin test = Bukkit.getServer().getPluginManager().getPlugin("Vault");
    if (test != null) {
        RegisteredServiceProvider<Economy> provider = Bukkit.getServer().getServicesManager().getRegistration(Economy.class);
        if (provider != null) {
            Economy economy = provider.getProvider();
            if (economy != null && economy.isEnabled()) {
                Jobs.setEconomy(plugin, new VaultEconomy(economy));
                Jobs.getPluginLogger().info("[" + plugin.getDescription().getName() + "] Successfully linked with Vault.");
                return;
            }
        }
    }
    // no Vault found
    Jobs.setEconomy(plugin, new BlackholeEconomy());
    Bukkit.getServer().getLogger().severe("==================== " + plugin.getDescription().getName() + " ====================");
    Bukkit.getServer().getLogger().severe("Vault is required by this plugin for economy support!");
    Bukkit.getServer().getLogger().severe("Please install Vault first!");
    Bukkit.getServer().getLogger().severe("You can find the latest version here:");
    Bukkit.getServer().getLogger().severe("http://dev.bukkit.org/server-mods/vault/");
    Bukkit.getServer().getLogger().severe("==============================================");
}
Also used : BlackholeEconomy(com.gamingmesh.jobs.economy.BlackholeEconomy) Economy(net.milkbowl.vault.economy.Economy) VaultEconomy(com.gamingmesh.jobs.economy.VaultEconomy) VaultEconomy(com.gamingmesh.jobs.economy.VaultEconomy) BlackholeEconomy(com.gamingmesh.jobs.economy.BlackholeEconomy) Plugin(org.bukkit.plugin.Plugin)

Aggregations

BlackholeEconomy (com.gamingmesh.jobs.economy.BlackholeEconomy)1 VaultEconomy (com.gamingmesh.jobs.economy.VaultEconomy)1 Economy (net.milkbowl.vault.economy.Economy)1 Plugin (org.bukkit.plugin.Plugin)1