mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-21 01:01:35 +08:00
Remove Essentials from Register to prevent recursion.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1451 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
477f8ae4b5
commit
16af2a2d61
Binary file not shown.
@ -27,14 +27,12 @@ dist.javadoc.dir=${dist.dir}/javadoc
|
||||
excludes=
|
||||
file.reference.BOSEconomy.jar=lib/BOSEconomy.jar
|
||||
file.reference.bukkit-0.0.1-SNAPSHOT.jar=../lib/bukkit-0.0.1-SNAPSHOT.jar
|
||||
file.reference.Essentials.jar=lib/Essentials.jar
|
||||
file.reference.iCo4.jar=lib/iCo4.jar
|
||||
file.reference.iCo5.jar=lib/iCo5.jar
|
||||
includes=**
|
||||
jar.compress=false
|
||||
javac.classpath=\
|
||||
${file.reference.BOSEconomy.jar}:\
|
||||
${file.reference.Essentials.jar}:\
|
||||
${file.reference.iCo4.jar}:\
|
||||
${file.reference.iCo5.jar}:\
|
||||
${file.reference.bukkit-0.0.1-SNAPSHOT.jar}
|
||||
|
@ -1,106 +0,0 @@
|
||||
package com.essentials.register.payment;
|
||||
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import com.earth2me.essentials.api.Economy;
|
||||
|
||||
public class MethodEEco implements Method {
|
||||
private Essentials Essentials;
|
||||
|
||||
public MethodEEco(Essentials Essentials) {
|
||||
this.Essentials = Essentials;
|
||||
}
|
||||
|
||||
public Essentials getPlugin() {
|
||||
return this.Essentials;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "EssentialsEco";
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return "2.2";
|
||||
}
|
||||
|
||||
public String format(double amount) {
|
||||
return Economy.format(amount);
|
||||
}
|
||||
|
||||
public boolean hasBanks() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasBank(String bank) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasAccount(String name) {
|
||||
return Economy.accountExist(name);
|
||||
}
|
||||
|
||||
public boolean hasBankAccount(String bank, String name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public MethodAccount getAccount(String name) {
|
||||
if(!hasAccount(name)) return null;
|
||||
return new EEcoAccount(name);
|
||||
}
|
||||
|
||||
public MethodBankAccount getBankAccount(String bank, String name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public class EEcoAccount implements MethodAccount {
|
||||
private String name;
|
||||
|
||||
public EEcoAccount(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public double balance() {
|
||||
return Economy.getMoney(this.name);
|
||||
}
|
||||
|
||||
public boolean add(double amount) {
|
||||
Economy.add(name, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean subtract(double amount) {
|
||||
Economy.subtract(name, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean multiply(double amount) {
|
||||
Economy.multiply(name, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean divide(double amount) {
|
||||
Economy.divide(name, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasEnough(double amount) {
|
||||
return Economy.hasEnough(name, amount);
|
||||
}
|
||||
|
||||
public boolean hasOver(double amount) {
|
||||
return Economy.hasMore(name, amount);
|
||||
}
|
||||
|
||||
public boolean hasUnder(double amount) {
|
||||
return Economy.hasLess(name, amount);
|
||||
}
|
||||
|
||||
public boolean isNegative() {
|
||||
return Economy.isNegative(name);
|
||||
}
|
||||
|
||||
public boolean remove() {
|
||||
Economy.removeAccount(name);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
@ -2,7 +2,6 @@ package com.essentials.register.payment;
|
||||
|
||||
import com.iConomy.iConomy;
|
||||
import cosine.boseconomy.BOSEconomy;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
@ -25,8 +24,6 @@ public class Methods {
|
||||
else { Method = new MethodiCo4((com.nijiko.coelho.iConomy.iConomy)method); }
|
||||
} else if(name.equalsIgnoreCase("boseconomy")) {
|
||||
Method = new MethodBOSEconomy((BOSEconomy)method);
|
||||
} else if(name.equalsIgnoreCase("essentials")) {
|
||||
Method = new MethodEEco((Essentials)method);
|
||||
}
|
||||
}
|
||||
|
||||
@ -39,9 +36,6 @@ public class Methods {
|
||||
} else if(loader.getPlugin("BOSEconomy") != null) {
|
||||
method = loader.getPlugin("BOSEconomy");
|
||||
Method = new MethodBOSEconomy((BOSEconomy)method);
|
||||
} else if(loader.getPlugin("Essentials") != null) {
|
||||
method = loader.getPlugin("Essentials");
|
||||
Method = new MethodEEco((Essentials)method);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user