From 848d0463db2e92f77db1e18b2f067026f9769db8 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sun, 29 Jan 2012 23:11:39 -0600 Subject: [PATCH] Delayed Vault economy integration not necessary after all; reverting added delay --- src/com/massivecraft/factions/P.java | 3 +- .../factions/integration/Econ.java | 55 +++++++------------ 2 files changed, 23 insertions(+), 35 deletions(-) diff --git a/src/com/massivecraft/factions/P.java b/src/com/massivecraft/factions/P.java index a64d26eb..b0d89cb8 100644 --- a/src/com/massivecraft/factions/P.java +++ b/src/com/massivecraft/factions/P.java @@ -99,7 +99,8 @@ public class P extends MPlugin //setupPermissions(); integrateEssentialsChat(); setupSpout(this); - Econ.initialSetup(this); + Econ.doSetup(); + Econ.oldMoneyDoTransfer(); CapiFeatures.setup(); setupLWC(); diff --git a/src/com/massivecraft/factions/integration/Econ.java b/src/com/massivecraft/factions/integration/Econ.java index 8237ae27..c07d5296 100644 --- a/src/com/massivecraft/factions/integration/Econ.java +++ b/src/com/massivecraft/factions/integration/Econ.java @@ -33,48 +33,35 @@ public class Econ return econ != null; } - public static void initialSetup(P p) - { - if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) - { - P.p.log("Economy integration is "+(Conf.econEnabled ? "enabled, but" : "disabled, and")+" the plugin \"Vault\" is not installed."); - return; - } - - p.getServer().getScheduler().scheduleSyncDelayedTask(p, new Runnable() - { - @Override - public void run() - { - doSetup(); - oldMoneyDoTransfer(); - } - }, 1); - } - public static void doSetup() { if (isSetup()) return; - - if (Bukkit.getServer().getPluginManager().getPlugin("Vault") != null) - { - RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class); - if (rsp == null) - { - P.p.log("Economy integration is "+(Conf.econEnabled ? "enabled" : "disabled")+", but the plugin \"Vault\" is not hooked into an economy plugin."); - return; - } - econ = rsp.getProvider(); - - P.p.log("Economy integration through Vault plugin successful."); - if ( ! Conf.econEnabled) - P.p.log("NOTE: Economy is disabled. Enable with command: f config econEnabled true"); + String integrationFail = "Economy integration is "+(Conf.econEnabled ? "enabled, but" : "disabled, and")+" the plugin \"Vault\" "; + + if (Bukkit.getServer().getPluginManager().getPlugin("Vault") == null) + { + P.p.log(integrationFail+"is not installed."); + return; } - + + RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class); + if (rsp == null) + { + P.p.log(integrationFail+"is not hooked into an economy plugin."); + return; + } + econ = rsp.getProvider(); + + P.p.log("Economy integration through Vault plugin successful."); + + if ( ! Conf.econEnabled) + P.p.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true"); + P.p.cmdBase.cmdHelp.updateHelp(); } + public static void modifyUniverseMoney(double delta) { if (!shouldBeUsed()) return;