From 79bbee126d2959834fb6be7cb266adb8198ce0f6 Mon Sep 17 00:00:00 2001 From: William Lebel Date: Tue, 5 Feb 2013 14:22:40 -0500 Subject: [PATCH] Updated Craftconomy hook to latest API changes. Made the pom.xml downloads from the repository. --- pom.xml | 12 +++++++----- .../economy/plugins/Economy_Craftconomy3.java | 18 +++++++++--------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/pom.xml b/pom.xml index 3cfe60c..7f4866b 100644 --- a/pom.xml +++ b/pom.xml @@ -231,11 +231,9 @@ ${project.basedir}/lib/Craftconomy.jar - me.greatmancode + com.greatmancode craftconomy3 - 3.0.0 - system - ${project.basedir}/lib/craftconomy3.jar + 3.1.0-SNAPSHOT net.crystalyx.bukkit.simplyperms @@ -371,9 +369,13 @@ iConomy 4,5,6 BOSEconomy 6/7, EssentialsEcon, 3Co, MultiConomy, MineConomy, Econ bukkit-repo http://repo.bukkit.org/content/groups/public/ - + sdfeconomy-repo http://omwah.sdf.org/maven/repo/snapshots/ + + greatman-repo + http://repo.greatmancode.com/content/groups/public/ + diff --git a/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy3.java b/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy3.java index 439659e..6565e1e 100644 --- a/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy3.java +++ b/src/net/milkbowl/vault/economy/plugins/Economy_Craftconomy3.java @@ -105,22 +105,22 @@ public class Economy_Craftconomy3 implements Economy { @Override public String format(double amount) { - return Common.getInstance().format(null, Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID), amount); + return Common.getInstance().format(null, Common.getInstance().getCurrencyManager().getDefaultCurrency(), amount); } @Override public String currencyNameSingular() { - return Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName(); + return Common.getInstance().getCurrencyManager().getDefaultCurrency().getName(); } @Override public String currencyNamePlural() { - return Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getPlural(); + return Common.getInstance().getCurrencyManager().getDefaultCurrency().getPlural(); } @Override public double getBalance(String playerName) { - return Common.getInstance().getAccountManager().getAccount(playerName).getBalance(Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName()); + return Common.getInstance().getAccountManager().getAccount(playerName).getBalance(Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getDefaultCurrency().getName()); } @Override @@ -131,8 +131,8 @@ public class Economy_Craftconomy3 implements Economy { double balance; Account account = Common.getInstance().getAccountManager().getAccount(playerName); - if (account.hasEnough(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName())) { - balance = account.withdraw(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName()); + if (account.hasEnough(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getDefaultCurrency().getName())) { + balance = account.withdraw(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getDefaultCurrency().getName()); return new EconomyResponse(amount, balance, ResponseType.SUCCESS, ""); } else { return new EconomyResponse(0, getBalance(playerName), ResponseType.FAILURE, "Insufficient funds"); @@ -147,7 +147,7 @@ public class Economy_Craftconomy3 implements Economy { Account account = Common.getInstance().getAccountManager().getAccount(playerName); - double balance = account.deposit(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName()); + double balance = account.deposit(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getDefaultCurrency().getName()); return new EconomyResponse(amount, balance, ResponseType.SUCCESS, null); } @@ -185,7 +185,7 @@ public class Economy_Craftconomy3 implements Economy { if (Common.getInstance().getAccountManager().exist(Account.BANK_PREFIX + name)) { Account account = Common.getInstance().getAccountManager().getAccount(Account.BANK_PREFIX + name); - if (account.hasEnough(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName())) { + if (account.hasEnough(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getDefaultCurrency().getName())) { return new EconomyResponse(0, bankBalance(Account.BANK_PREFIX + name).balance, ResponseType.SUCCESS, ""); } else { return new EconomyResponse(0, bankBalance(Account.BANK_PREFIX + name).balance, ResponseType.FAILURE, "The bank does not have enough money!"); @@ -267,7 +267,7 @@ public class Economy_Craftconomy3 implements Economy { ArrayList list = new ArrayList(); Iterator iterator = accountList.iterator(); while (iterator.hasNext()) { - list.add(iterator.next().name.replaceFirst(Account.BANK_PREFIX, "")); + list.add(iterator.next().getName().replaceFirst(Account.BANK_PREFIX, "")); } return list;