mirror of
https://github.com/MilkBowl/Vault.git
synced 2024-11-23 11:05:48 +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>
|
<systemPath>${project.basedir}/lib/Craftconomy.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.greatmancode</groupId>
|
<groupId>com.greatmancode</groupId>
|
||||||
<artifactId>craftconomy3</artifactId>
|
<artifactId>craftconomy3</artifactId>
|
||||||
<version>3.0.0</version>
|
<version>3.1.0-SNAPSHOT</version>
|
||||||
<scope>system</scope>
|
|
||||||
<systemPath>${project.basedir}/lib/craftconomy3.jar</systemPath>
|
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.crystalyx.bukkit.simplyperms</groupId>
|
<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>
|
<id>bukkit-repo</id>
|
||||||
<url>http://repo.bukkit.org/content/groups/public/</url>
|
<url>http://repo.bukkit.org/content/groups/public/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>sdfeconomy-repo</id>
|
<id>sdfeconomy-repo</id>
|
||||||
<url>http://omwah.sdf.org/maven/repo/snapshots/</url>
|
<url>http://omwah.sdf.org/maven/repo/snapshots/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>greatman-repo</id>
|
||||||
|
<url>http://repo.greatmancode.com/content/groups/public/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
</project>
|
</project>
|
||||||
|
@ -31,8 +31,8 @@ public interface Economy {
|
|||||||
public boolean isEnabled();
|
public boolean isEnabled();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets name of permission method
|
* Gets name of economy method
|
||||||
* @return Name of Permission Method
|
* @return Name of Ecoomy Method
|
||||||
*/
|
*/
|
||||||
public String getName();
|
public String getName();
|
||||||
|
|
||||||
@ -196,4 +196,4 @@ public interface Economy {
|
|||||||
* @return if the account creation was successful
|
* @return if the account creation was successful
|
||||||
*/
|
*/
|
||||||
public boolean createPlayerAccount(String playerName);
|
public boolean createPlayerAccount(String playerName);
|
||||||
}
|
}
|
||||||
|
@ -105,22 +105,22 @@ public class Economy_Craftconomy3 implements Economy {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String format(double amount) {
|
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
|
@Override
|
||||||
public String currencyNameSingular() {
|
public String currencyNameSingular() {
|
||||||
return Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName();
|
return Common.getInstance().getCurrencyManager().getDefaultCurrency().getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String currencyNamePlural() {
|
public String currencyNamePlural() {
|
||||||
return Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getPlural();
|
return Common.getInstance().getCurrencyManager().getDefaultCurrency().getPlural();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getBalance(String playerName) {
|
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
|
@Override
|
||||||
@ -131,8 +131,8 @@ public class Economy_Craftconomy3 implements Economy {
|
|||||||
|
|
||||||
double balance;
|
double balance;
|
||||||
Account account = Common.getInstance().getAccountManager().getAccount(playerName);
|
Account account = Common.getInstance().getAccountManager().getAccount(playerName);
|
||||||
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())) {
|
||||||
balance = account.withdraw(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getCurrency(CurrencyManager.defaultCurrencyID).getName());
|
balance = account.withdraw(amount, Common.getInstance().getServerCaller().getDefaultWorld(), Common.getInstance().getCurrencyManager().getDefaultCurrency().getName());
|
||||||
return new EconomyResponse(amount, balance, ResponseType.SUCCESS, "");
|
return new EconomyResponse(amount, balance, ResponseType.SUCCESS, "");
|
||||||
} else {
|
} else {
|
||||||
return new EconomyResponse(0, getBalance(playerName), ResponseType.FAILURE, "Insufficient funds");
|
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);
|
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);
|
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)) {
|
if (Common.getInstance().getAccountManager().exist(Account.BANK_PREFIX + name)) {
|
||||||
Account account = Common.getInstance().getAccountManager().getAccount(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, "");
|
return new EconomyResponse(0, bankBalance(Account.BANK_PREFIX + name).balance, ResponseType.SUCCESS, "");
|
||||||
} else {
|
} else {
|
||||||
return new EconomyResponse(0, bankBalance(Account.BANK_PREFIX + name).balance, ResponseType.FAILURE, "The bank does not have enough money!");
|
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>();
|
ArrayList<String> list = new ArrayList<String>();
|
||||||
Iterator<AccountTable> iterator = accountList.iterator();
|
Iterator<AccountTable> iterator = accountList.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
list.add(iterator.next().name.replaceFirst(Account.BANK_PREFIX, ""));
|
list.add(iterator.next().getName().replaceFirst(Account.BANK_PREFIX, ""));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user