This commit is contained in:
Nick Minkler 2013-02-06 16:25:52 -08:00
commit 30a9603647
3 changed files with 19 additions and 17 deletions

10
pom.xml
View File

@ -231,11 +231,9 @@
<systemPath>${project.basedir}/lib/Craftconomy.jar</systemPath>
</dependency>
<dependency>
<groupId>me.greatmancode</groupId>
<groupId>com.greatmancode</groupId>
<artifactId>craftconomy3</artifactId>
<version>3.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/craftconomy3.jar</systemPath>
<version>3.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.crystalyx.bukkit.simplyperms</groupId>
@ -375,5 +373,9 @@ iConomy 4,5,6 BOSEconomy 6/7, EssentialsEcon, 3Co, MultiConomy, MineConomy, Econ
<id>sdfeconomy-repo</id>
<url>http://omwah.sdf.org/maven/repo/snapshots/</url>
</repository>
<repository>
<id>greatman-repo</id>
<url>http://repo.greatmancode.com/content/groups/public/</url>
</repository>
</repositories>
</project>

View File

@ -31,8 +31,8 @@ public interface Economy {
public boolean isEnabled();
/**
* Gets name of permission method
* @return Name of Permission Method
* Gets name of economy method
* @return Name of Ecoomy Method
*/
public String getName();

View File

@ -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<String> list = new ArrayList<String>();
Iterator<AccountTable> 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;