mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-27 04:55:33 +01:00
don't check if economy is enabled in PluginEnableEvent assume it is
being enabled and add the hook.
This commit is contained in:
parent
30a9603647
commit
a514f066c8
@ -158,7 +158,7 @@ public class Economy_3co implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin eco = plugin.getServer().getPluginManager().getPlugin("3co");
|
||||
|
||||
if (eco != null && eco.isEnabled()) {
|
||||
if (eco != null) {
|
||||
economy.economy = (ECO) eco;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class Economy_AEco implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin eco = plugin.getServer().getPluginManager().getPlugin("AEco");
|
||||
|
||||
if (eco != null && eco.isEnabled()) {
|
||||
if (eco != null) {
|
||||
economy.economy = AEco.ECONOMY;
|
||||
try {
|
||||
createWallet = economy.getClass().getMethod("createWallet", String.class);
|
||||
|
@ -171,7 +171,7 @@ public class Economy_BOSE6 implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin bose = plugin.getServer().getPluginManager().getPlugin("BOSEconomy");
|
||||
|
||||
if (bose != null && bose.isEnabled() && bose.getDescription().getVersion().startsWith("0.6")) {
|
||||
if (bose != null && bose.getDescription().getVersion().startsWith("0.6")) {
|
||||
economy.economy = (BOSEconomy) bose;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public class Economy_BOSE7 implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin bose = plugin.getServer().getPluginManager().getPlugin("BOSEconomy");
|
||||
|
||||
if (bose != null && bose.isEnabled() && bose.getDescription().getVersion().startsWith("0.7")) {
|
||||
if (bose != null && bose.getDescription().getVersion().startsWith("0.7")) {
|
||||
economy.economy = (BOSEconomy) bose;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ public class Economy_CommandsEX implements net.milkbowl.vault.economy.Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin cex = plugin.getServer().getPluginManager().getPlugin("CommandsEX");
|
||||
|
||||
if (cex != null && cex.isEnabled()) {
|
||||
if (cex != null) {
|
||||
economy.economy = (CommandsEX) cex;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class Economy_Craftconomy implements Economy {
|
||||
// Load Plugin in case it was loaded before
|
||||
if (economy == null) {
|
||||
Plugin ec = plugin.getServer().getPluginManager().getPlugin("Craftconomy");
|
||||
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("me.greatman.Craftconomy.Craftconomy")) {
|
||||
if (ec != null && ec.getClass().getName().equals("me.greatman.Craftconomy.Craftconomy")) {
|
||||
economy = (Craftconomy) ec;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), name));
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public class Economy_Craftconomy3 implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin ec = plugin.getServer().getPluginManager().getPlugin("Craftconomy3");
|
||||
|
||||
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.greatmancode.craftconomy3.BukkitLoader")) {
|
||||
if (ec != null && ec.getClass().getName().equals("com.greatmancode.craftconomy3.BukkitLoader")) {
|
||||
economy.economy = (BukkitLoader) ec;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -31,26 +31,22 @@ public class Economy_Dosh implements Economy {
|
||||
|
||||
Plugin plugin;
|
||||
Dosh doshPlugin;
|
||||
boolean isEnabled = false;
|
||||
DoshAPIHandler apiHandle;
|
||||
|
||||
public Economy_Dosh(Plugin _plugin) {
|
||||
|
||||
plugin = _plugin;
|
||||
|
||||
if (plugin.getServer().getPluginManager().isPluginEnabled("Dosh")) {
|
||||
doshPlugin = (Dosh) plugin.getServer().getPluginManager().getPlugin("Dosh");
|
||||
apiHandle = new DoshAPIHandler();
|
||||
isEnabled = true;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return isEnabled;
|
||||
return apiHandle != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -68,7 +68,7 @@ public class Economy_EconXP implements Economy {
|
||||
if (economy.econ == null) {
|
||||
Plugin eco = plugin.getServer().getPluginManager().getPlugin("EconXP");
|
||||
|
||||
if (eco != null && eco.isEnabled()) {
|
||||
if (eco != null) {
|
||||
economy.econ = (EconXP) eco;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class Economy_Essentials implements Economy {
|
||||
if (economy.ess == null) {
|
||||
Plugin essentials = plugin.getServer().getPluginManager().getPlugin("Essentials");
|
||||
|
||||
if (essentials != null && essentials.isEnabled()) {
|
||||
if (essentials != null) {
|
||||
economy.ess = (Essentials) essentials;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class Economy_GoldIsMoney implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin ec = plugin.getServer().getPluginManager().getPlugin("GoldIsMoney");
|
||||
|
||||
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.flobi.GoldIsMoney.GoldIsMoney")) {
|
||||
if (ec != null && ec.getClass().getName().equals("com.flobi.GoldIsMoney.GoldIsMoney")) {
|
||||
economy.economy = (GoldIsMoney) ec;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -266,7 +266,7 @@ public class Economy_GoldIsMoney2 implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin ec = plugin.getServer().getPluginManager().getPlugin("GoldIsMoney");
|
||||
|
||||
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.flobi.GoldIsMoney2.GoldIsMoney")) {
|
||||
if (ec != null && ec.getClass().getName().equals("com.flobi.GoldIsMoney2.GoldIsMoney")) {
|
||||
economy.economy = (GoldIsMoney) ec;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ public class Economy_Gringotts implements Economy {
|
||||
if (economy.gringotts == null) {
|
||||
Plugin grngts = plugin.getServer().getPluginManager().getPlugin("Gringotts");
|
||||
|
||||
if (grngts != null && grngts.isEnabled()) {
|
||||
if (grngts != null) {
|
||||
economy.gringotts = (Gringotts) grngts;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ public class Economy_McMoney implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin eco = plugin.getServer().getPluginManager().getPlugin("McMoney");
|
||||
|
||||
if (eco != null && eco.isEnabled()) {
|
||||
if (eco != null) {
|
||||
economy.economy = McMoneyAPI.getInstance();
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class Economy_MineConomy implements Economy {
|
||||
if (economy.econ == null) {
|
||||
Plugin eco = plugin.getServer().getPluginManager().getPlugin("MineConomy");
|
||||
|
||||
if (eco != null && eco.isEnabled()) {
|
||||
if (eco != null) {
|
||||
economy.econ = (MineConomy) eco;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ public class Economy_MultiCurrency implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin mcur = plugin.getServer().getPluginManager().getPlugin("MultiCurrency");
|
||||
|
||||
if (mcur != null && mcur.isEnabled()) {
|
||||
if (mcur != null) {
|
||||
economy.economy = (Currency) mcur;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class Economy_XPBank implements Economy {
|
||||
if (economy.XPB == null) {
|
||||
Plugin eco = plugin.getServer().getPluginManager().getPlugin("XPBank");
|
||||
|
||||
if (eco != null && eco.isEnabled()) {
|
||||
if (eco != null) {
|
||||
economy.XPB = (XPBank) eco;
|
||||
api = XPB.getAPI();
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
|
@ -65,7 +65,7 @@ public class Economy_eWallet implements Economy {
|
||||
if (economy.econ == null) {
|
||||
Plugin eco = plugin.getServer().getPluginManager().getPlugin("eWallet");
|
||||
|
||||
if (eco != null && eco.isEnabled()) {
|
||||
if (eco != null) {
|
||||
economy.econ = (ECO) eco;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ public class Economy_iConomy4 implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin iConomy = plugin.getServer().getPluginManager().getPlugin("iConomy");
|
||||
|
||||
if (iConomy != null && iConomy.isEnabled() && iConomy.getClass().getName().equals("com.nijiko.coelho.iConomy.iConomy")) {
|
||||
if (iConomy != null && iConomy.getClass().getName().equals("com.nijiko.coelho.iConomy.iConomy")) {
|
||||
economy.economy = (iConomy) iConomy;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public class Economy_iConomy5 implements Economy {
|
||||
if (economy.economy == null) {
|
||||
Plugin ec = plugin.getServer().getPluginManager().getPlugin("iConomy");
|
||||
|
||||
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.iConomy.iConomy")) {
|
||||
if (ec != null && ec.getClass().getName().equals("com.iConomy.iConomy")) {
|
||||
economy.economy = (iConomy) ec;
|
||||
log.info(String.format("[%s][Economy] %s hooked.", plugin.getDescription().getName(), economy.name));
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class Economy_iConomy6 implements Economy {
|
||||
public void onPluginEnable(PluginEnableEvent event) {
|
||||
if (economy.economy == null) {
|
||||
Plugin ec = plugin.getServer().getPluginManager().getPlugin("iConomy");
|
||||
if (ec != null && ec.isEnabled() && ec.getClass().getName().equals("com.iCo6.iConomy")) {
|
||||
if (ec != null && ec.getClass().getName().equals("com.iCo6.iConomy")) {
|
||||
String version = ec.getDescription().getVersion().split("\\.")[0];
|
||||
name += version;
|
||||
economy.economy = (iConomy) ec;
|
||||
|
Loading…
Reference in New Issue
Block a user