Updated economy support

This commit is contained in:
Garbage Mule
2011-09-22 11:50:01 +02:00
parent 0badeaaf90
commit c126bf36e9
16 changed files with 260 additions and 126 deletions
@@ -1,6 +1,7 @@
package com.garbagemule.register.payment.methods;
import com.garbagemule.register.payment.Method;
import cosine.boseconomy.BOSEconomy;
import org.bukkit.plugin.Plugin;
@@ -26,10 +27,17 @@ public class BOSE7 implements Method {
public String getVersion() {
return "0.7.0";
}
public int fractionalDigits() {
return this.BOSEconomy.getFractionalDigits();
}
public String format(double amount) {
String currency = this.BOSEconomy.getMoneyNamePlural();
if(amount == 1) currency = this.BOSEconomy.getMoneyName();
if(amount == 1)
currency = this.BOSEconomy.getMoneyName();
return amount + " " + currency;
}
@@ -50,17 +58,23 @@ public class BOSE7 implements Method {
}
public MethodAccount getAccount(String name) {
if(!hasAccount(name)) return null;
if(!hasAccount(name))
return null;
return new BOSEAccount(name, this.BOSEconomy);
}
public MethodBankAccount getBankAccount(String bank, String name) {
if(!hasBankAccount(bank, name)) return null;
if(!hasBankAccount(bank, name))
return null;
return new BOSEBankAccount(bank, BOSEconomy);
}
public boolean isCompatible(Plugin plugin) {
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy") && plugin instanceof BOSEconomy && !plugin.getDescription().getVersion().equals("0.6.2");
return plugin.getDescription().getName().equalsIgnoreCase("boseconomy")
&& plugin instanceof BOSEconomy
&& !plugin.getDescription().getVersion().equals("0.6.2");
}
public void setPlugin(Plugin plugin) {