protected JailPayManager(JailMain plugin) { this.item = Material.getMaterial( plugin.getConfig().getString(Settings.JAILPAYITEM.getPath().toUpperCase())); if (this.item == null) this.item = Material.AIR; this.minteCost = plugin.getConfig().getDouble(Settings.JAILPAYPRICEPERMINUTE.getPath()); if (!this.usingItemsForPayment()) { if (!this.setupEconomy(plugin)) { plugin.getConfig().set(Settings.JAILPAYENABLED.getPath(), false); } } this.timed = plugin.getConfig().getDouble(Settings.JAILPAYPRICEPERMINUTE.getPath()) != 0; this.infinite = plugin.getConfig().getDouble(Settings.JAILPAYPRICEINFINITE.getPath()) != 0; }
private boolean setupEconomy(JailMain plugin) { if (economy != null) return true; RegisteredServiceProvider<Economy> economyProvider = plugin .getServer() .getServicesManager() .getRegistration(net.milkbowl.vault.economy.Economy.class); if (economyProvider != null) { economy = economyProvider.getProvider(); } return (economy != null); }