mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-12-28 03:48:17 +01:00
Merge branch 'master' of https://Sleaker@github.com/MilkBowl/Vault.git
This commit is contained in:
commit
30a9603647
12
pom.xml
12
pom.xml
@ -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>
|
||||
@ -371,9 +369,13 @@ iConomy 4,5,6 BOSEconomy 6/7, EssentialsEcon, 3Co, MultiConomy, MineConomy, Econ
|
||||
<id>bukkit-repo</id>
|
||||
<url>http://repo.bukkit.org/content/groups/public/</url>
|
||||
</repository>
|
||||
<repository>
|
||||
<repository>
|
||||
<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>
|
||||
|
@ -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();
|
||||
|
||||
@ -196,4 +196,4 @@ public interface Economy {
|
||||
* @return if the account creation was successful
|
||||
*/
|
||||
public boolean createPlayerAccount(String playerName);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user