mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-26 18:11:52 +01:00
Remove deprecated economy libs and support
None of these economy plugins are supported any more, and removing these allows EssentialsX to be used as a dependency without locally `mvn install`ing the plugin.
This commit is contained in:
parent
768b92749f
commit
bef440760a
@ -45,34 +45,6 @@
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>BOSEconomy</groupId>
|
||||
<artifactId>BOSEconomy</artifactId>
|
||||
<version>v0.7.8.1</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/../lib/BOSEconomy.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>iConomy</groupId>
|
||||
<artifactId>iConomy5</artifactId>
|
||||
<version>5</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/../lib/iCo5.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>iConomy</groupId>
|
||||
<artifactId>iConomy6</artifactId>
|
||||
<version>6</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/../lib/iCo6.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>MultiCurrency</groupId>
|
||||
<artifactId>MultiCurrency</artifactId>
|
||||
<version>2.2</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/../lib/MultiCurrency.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>Vault</artifactId>
|
||||
|
@ -42,11 +42,6 @@ public class Methods {
|
||||
* Implement all methods along with their respective name & class.
|
||||
*/
|
||||
private static void _init() {
|
||||
addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo6());
|
||||
addMethod("iConomy", new com.earth2me.essentials.register.payment.methods.iCo5());
|
||||
addMethod("BOSEconomy", new com.earth2me.essentials.register.payment.methods.BOSE7());
|
||||
addMethod("Currency", new com.earth2me.essentials.register.payment.methods.MCUR());
|
||||
Dependencies.add("MultiCurrency");
|
||||
addMethod("Vault", new com.earth2me.essentials.register.payment.methods.VaultEco());
|
||||
}
|
||||
|
||||
|
@ -1,271 +0,0 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import cosine.boseconomy.BOSEconomy;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* BOSEconomy 7 Implementation of Method
|
||||
*
|
||||
* @author Acrobot
|
||||
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright (c) 2011 @license AOL license
|
||||
* <http://aol.nexua.org>
|
||||
*/
|
||||
public class BOSE7 implements Method {
|
||||
private BOSEconomy BOSEconomy;
|
||||
|
||||
@Override
|
||||
public BOSEconomy getPlugin() {
|
||||
return this.BOSEconomy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "BOSEconomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "0.7.0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fractionalDigits() {
|
||||
return this.BOSEconomy.getFractionalDigits();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(double amount) {
|
||||
String currency = this.BOSEconomy.getMoneyNamePlural();
|
||||
|
||||
if (amount == 1) {
|
||||
currency = this.BOSEconomy.getMoneyName();
|
||||
}
|
||||
|
||||
return amount + " " + currency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBanks() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBank(String bank) {
|
||||
return this.BOSEconomy.bankExists(bank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAccount(String name) {
|
||||
return this.BOSEconomy.playerRegistered(name, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return this.BOSEconomy.isBankOwner(bank, name) || this.BOSEconomy.isBankMember(bank, name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name) {
|
||||
if (hasAccount(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.BOSEconomy.registerPlayer(name);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name, Double balance) {
|
||||
if (hasAccount(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.BOSEconomy.registerPlayer(name);
|
||||
this.BOSEconomy.setPlayerMoney(name, balance, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodAccount getAccount(String name) {
|
||||
if (!hasAccount(name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new BOSEAccount(name, this.BOSEconomy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
if (!hasBankAccount(bank, name)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new BOSEBankAccount(bank, BOSEconomy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy") && plugin instanceof BOSEconomy && !plugin.getDescription().getVersion().equals("0.6.2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlugin(Plugin plugin) {
|
||||
BOSEconomy = (BOSEconomy) plugin;
|
||||
}
|
||||
|
||||
|
||||
public class BOSEAccount implements MethodAccount {
|
||||
private final String name;
|
||||
private final BOSEconomy BOSEconomy;
|
||||
|
||||
public BOSEAccount(String name, BOSEconomy bOSEconomy) {
|
||||
this.name = name;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance() {
|
||||
return this.BOSEconomy.getPlayerMoneyDouble(this.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount) {
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, amount, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount) {
|
||||
return this.BOSEconomy.addPlayerMoney(this.name, amount, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance - amount), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance * amount), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setPlayerMoney(this.name, (balance / amount), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount) {
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount) {
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount) {
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative() {
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class BOSEBankAccount implements MethodBankAccount {
|
||||
private final String bank;
|
||||
private final BOSEconomy BOSEconomy;
|
||||
|
||||
public BOSEBankAccount(String bank, BOSEconomy bOSEconomy) {
|
||||
this.bank = bank;
|
||||
this.BOSEconomy = bOSEconomy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBankName() {
|
||||
return this.bank;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBankId() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance() {
|
||||
return this.BOSEconomy.getBankMoneyDouble(bank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount) {
|
||||
return this.BOSEconomy.setBankMoney(bank, amount, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance + amount), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance - amount), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance * amount), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount) {
|
||||
double balance = this.balance();
|
||||
return this.BOSEconomy.setBankMoney(bank, (balance / amount), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount) {
|
||||
return (this.balance() >= amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount) {
|
||||
return (this.balance() > amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount) {
|
||||
return (this.balance() < amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative() {
|
||||
return (this.balance() < 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove() {
|
||||
return this.BOSEconomy.removeBank(bank);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,163 +0,0 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import me.ashtheking.currency.Currency;
|
||||
import me.ashtheking.currency.CurrencyList;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* MultiCurrency Method implementation.
|
||||
*
|
||||
* @author Acrobot @copyright (c) 2011 @license AOL license <http://aol.nexua.org>
|
||||
*/
|
||||
public class MCUR implements Method {
|
||||
private Currency currencyList;
|
||||
|
||||
@Override
|
||||
public Object getPlugin() {
|
||||
return this.currencyList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "MultiCurrency";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "0.09";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fractionalDigits() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(double amount) {
|
||||
return amount + " Currency";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBanks() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBank(String bank) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAccount(String name) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name) {
|
||||
CurrencyList.setValue((String) CurrencyList.maxCurrency(name)[0], name, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name, Double balance) {
|
||||
CurrencyList.setValue((String) CurrencyList.maxCurrency(name)[0], name, balance);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodAccount getAccount(String name) {
|
||||
return new MCurrencyAccount(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return (plugin.getDescription().getName().equalsIgnoreCase("Currency") || plugin.getDescription().getName().equalsIgnoreCase("MultiCurrency")) && plugin instanceof Currency;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlugin(Plugin plugin) {
|
||||
currencyList = (Currency) plugin;
|
||||
}
|
||||
|
||||
|
||||
public class MCurrencyAccount implements MethodAccount {
|
||||
private final String name;
|
||||
|
||||
public MCurrencyAccount(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance() {
|
||||
return CurrencyList.getValue((String) CurrencyList.maxCurrency(name)[0], name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount) {
|
||||
CurrencyList.setValue((String) CurrencyList.maxCurrency(name)[0], name, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount) {
|
||||
return CurrencyList.add(name, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount) {
|
||||
return CurrencyList.subtract(name, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount) {
|
||||
return CurrencyList.multiply(name, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount) {
|
||||
return CurrencyList.divide(name, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount) {
|
||||
return CurrencyList.hasEnough(name, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount) {
|
||||
return CurrencyList.hasOver(name, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount) {
|
||||
return CurrencyList.hasUnder(name, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative() {
|
||||
return CurrencyList.isNegative(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove() {
|
||||
return CurrencyList.remove(name);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,312 +0,0 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import com.iConomy.iConomy;
|
||||
import com.iConomy.system.Account;
|
||||
import com.iConomy.system.BankAccount;
|
||||
import com.iConomy.system.Holdings;
|
||||
import com.iConomy.util.Constants;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* iConomy 5 Implementation of Method
|
||||
*
|
||||
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright (c) 2011 @license AOL license
|
||||
* <http://aol.nexua.org>
|
||||
*/
|
||||
public class iCo5 implements Method {
|
||||
private iConomy iConomy;
|
||||
|
||||
@Override
|
||||
public iConomy getPlugin() {
|
||||
return this.iConomy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "iConomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "5";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fractionalDigits() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(double amount) {
|
||||
return com.iConomy.iConomy.format(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBanks() {
|
||||
return Constants.Banking;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBank(String bank) {
|
||||
return (hasBanks()) && com.iConomy.iConomy.Banks.exists(bank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAccount(String name) {
|
||||
return com.iConomy.iConomy.hasAccount(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return (hasBank(bank)) && com.iConomy.iConomy.getBank(bank).hasAccount(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name) {
|
||||
if (hasAccount(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return com.iConomy.iConomy.Accounts.create(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name, Double balance) {
|
||||
if (hasAccount(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!com.iConomy.iConomy.Accounts.create(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
getAccount(name).set(balance);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodAccount getAccount(String name) {
|
||||
return new iCoAccount(com.iConomy.iConomy.getAccount(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
return new iCoBankAccount(com.iConomy.iConomy.getBank(bank).getAccount(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy") && plugin.getClass().getName().equals("com.iConomy.iConomy") && plugin instanceof iConomy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlugin(Plugin plugin) {
|
||||
iConomy = (iConomy) plugin;
|
||||
}
|
||||
|
||||
|
||||
public class iCoAccount implements MethodAccount {
|
||||
private final Account account;
|
||||
private final Holdings holdings;
|
||||
|
||||
public iCoAccount(Account account) {
|
||||
this.account = account;
|
||||
this.holdings = account.getHoldings();
|
||||
}
|
||||
|
||||
public Account getiCoAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance() {
|
||||
return this.holdings.balance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.set(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.add(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.subtract(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.multiply(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.divide(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount) {
|
||||
return this.holdings.hasEnough(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount) {
|
||||
return this.holdings.hasOver(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount) {
|
||||
return this.holdings.hasUnder(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative() {
|
||||
return this.holdings.isNegative();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove() {
|
||||
if (this.account == null) {
|
||||
return false;
|
||||
}
|
||||
this.account.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class iCoBankAccount implements MethodBankAccount {
|
||||
private final BankAccount account;
|
||||
private final Holdings holdings;
|
||||
|
||||
public iCoBankAccount(BankAccount account) {
|
||||
this.account = account;
|
||||
this.holdings = account.getHoldings();
|
||||
}
|
||||
|
||||
public BankAccount getiCoBankAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBankName() {
|
||||
return this.account.getBankName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBankId() {
|
||||
return this.account.getBankId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance() {
|
||||
return this.holdings.balance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.set(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.add(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.subtract(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.multiply(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.divide(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount) {
|
||||
return this.holdings.hasEnough(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount) {
|
||||
return this.holdings.hasOver(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount) {
|
||||
return this.holdings.hasUnder(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative() {
|
||||
return this.holdings.isNegative();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove() {
|
||||
if (this.account == null) {
|
||||
return false;
|
||||
}
|
||||
this.account.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,201 +0,0 @@
|
||||
package com.earth2me.essentials.register.payment.methods;
|
||||
|
||||
import com.earth2me.essentials.register.payment.Method;
|
||||
import com.iCo6.iConomy;
|
||||
import com.iCo6.system.Account;
|
||||
import com.iCo6.system.Accounts;
|
||||
import com.iCo6.system.Holdings;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
|
||||
/**
|
||||
* iConomy 6 Implementation of Method
|
||||
*
|
||||
* @author Nijikokun <nijikokun@shortmail.com> (@nijikokun) @copyright (c) 2011 @license AOL license
|
||||
* <http://aol.nexua.org>
|
||||
*/
|
||||
public class iCo6 implements Method {
|
||||
private iConomy iConomy;
|
||||
|
||||
@Override
|
||||
public iConomy getPlugin() {
|
||||
return this.iConomy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "iConomy";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLongName() {
|
||||
return getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return "6";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fractionalDigits() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String format(double amount) {
|
||||
return com.iCo6.iConomy.format(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBanks() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBank(String bank) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasAccount(String name) {
|
||||
return (new Accounts()).exists(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name) {
|
||||
if (hasAccount(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (new Accounts()).create(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createAccount(String name, Double balance) {
|
||||
if (hasAccount(name)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (new Accounts()).create(name, balance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodAccount getAccount(String name) {
|
||||
return new iCoAccount((new Accounts()).get(name));
|
||||
}
|
||||
|
||||
@Override
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompatible(Plugin plugin) {
|
||||
return plugin.getDescription().getName().equalsIgnoreCase("iconomy") && plugin.getClass().getName().equals("com.iCo6.iConomy") && plugin instanceof iConomy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPlugin(Plugin plugin) {
|
||||
iConomy = (iConomy) plugin;
|
||||
}
|
||||
|
||||
|
||||
public class iCoAccount implements MethodAccount {
|
||||
private final Account account;
|
||||
private final Holdings holdings;
|
||||
|
||||
public iCoAccount(Account account) {
|
||||
this.account = account;
|
||||
this.holdings = account.getHoldings();
|
||||
}
|
||||
|
||||
public Account getiCoAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double balance() {
|
||||
return this.holdings.getBalance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean set(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.setBalance(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.add(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean subtract(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.subtract(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean multiply(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.multiply(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean divide(double amount) {
|
||||
if (this.holdings == null) {
|
||||
return false;
|
||||
}
|
||||
this.holdings.divide(amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasEnough(double amount) {
|
||||
return this.holdings.hasEnough(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasOver(double amount) {
|
||||
return this.holdings.hasOver(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasUnder(double amount) {
|
||||
return this.holdings.hasUnder(amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNegative() {
|
||||
return this.holdings.isNegative();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove() {
|
||||
if (this.account == null) {
|
||||
return false;
|
||||
}
|
||||
this.account.remove();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
BIN
lib/iCo5.jar
BIN
lib/iCo5.jar
Binary file not shown.
BIN
lib/iCo6.jar
BIN
lib/iCo6.jar
Binary file not shown.
Loading…
Reference in New Issue
Block a user