From ea52e817b56c3b0df0d87007b278b60298cf6fbb Mon Sep 17 00:00:00 2001 From: snowleo Date: Fri, 13 May 2011 23:39:18 +0000 Subject: Move Register stuff inside Essentials git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1454 e251c2fe-e539-e718-e476-b85c1f46cddb --- Essentials/build.xml | 4 +- Essentials/nbproject/build-impl.xml | 14 - Essentials/nbproject/genfiles.properties | 4 +- Essentials/nbproject/project.properties | 11 +- Essentials/nbproject/project.xml | 11 +- .../src/com/earth2me/essentials/Essentials.java | 2 +- Essentials/src/com/earth2me/essentials/User.java | 2 +- .../essentials/register/payment/Method.java | 48 + .../register/payment/MethodBOSEconomy.java | 180 ++++ .../essentials/register/payment/MethodiCo4.java | 114 +++ .../essentials/register/payment/MethodiCo5.java | 191 ++++ .../essentials/register/payment/Methods.java | 70 ++ EssentialsChat/nbproject/build-impl.xml | 14 - EssentialsChat/nbproject/genfiles.properties | 4 +- EssentialsChat/nbproject/project.properties | 5 +- EssentialsChat/nbproject/project.xml | 8 - EssentialsGeoIP/nbproject/build-impl.xml | 14 - EssentialsGeoIP/nbproject/genfiles.properties | 6 +- EssentialsGeoIP/nbproject/project.properties | 5 +- EssentialsGeoIP/nbproject/project.xml | 8 - EssentialsProtect/nbproject/build-impl.xml | 14 - EssentialsProtect/nbproject/genfiles.properties | 4 +- EssentialsProtect/nbproject/project.properties | 5 +- EssentialsProtect/nbproject/project.xml | 8 - EssentialsSpawn/nbproject/build-impl.xml | 14 - EssentialsSpawn/nbproject/genfiles.properties | 4 +- EssentialsSpawn/nbproject/project.properties | 5 +- EssentialsSpawn/nbproject/project.xml | 8 - Register/README | 7 - Register/build.xml | 74 -- Register/manifest.mf | 3 - Register/nbproject/build-impl.xml | 1066 -------------------- Register/nbproject/genfiles.properties | 8 - Register/nbproject/project.properties | 80 -- Register/nbproject/project.xml | 18 - .../com/essentials/register/payment/Method.java | 48 - .../register/payment/MethodBOSEconomy.java | 180 ---- .../essentials/register/payment/MethodiCo4.java | 114 --- .../essentials/register/payment/MethodiCo5.java | 191 ---- .../com/essentials/register/payment/Methods.java | 70 -- 40 files changed, 630 insertions(+), 2006 deletions(-) create mode 100644 Essentials/src/com/earth2me/essentials/register/payment/Method.java create mode 100644 Essentials/src/com/earth2me/essentials/register/payment/MethodBOSEconomy.java create mode 100644 Essentials/src/com/earth2me/essentials/register/payment/MethodiCo4.java create mode 100644 Essentials/src/com/earth2me/essentials/register/payment/MethodiCo5.java create mode 100644 Essentials/src/com/earth2me/essentials/register/payment/Methods.java delete mode 100644 Register/README delete mode 100644 Register/build.xml delete mode 100644 Register/manifest.mf delete mode 100644 Register/nbproject/build-impl.xml delete mode 100644 Register/nbproject/genfiles.properties delete mode 100644 Register/nbproject/project.properties delete mode 100644 Register/nbproject/project.xml delete mode 100644 Register/src/com/essentials/register/payment/Method.java delete mode 100644 Register/src/com/essentials/register/payment/MethodBOSEconomy.java delete mode 100644 Register/src/com/essentials/register/payment/MethodiCo4.java delete mode 100644 Register/src/com/essentials/register/payment/MethodiCo5.java delete mode 100644 Register/src/com/essentials/register/payment/Methods.java diff --git a/Essentials/build.xml b/Essentials/build.xml index b14c52e4c..abd4ebe55 100644 --- a/Essentials/build.xml +++ b/Essentials/build.xml @@ -72,7 +72,7 @@ nbproject/build-impl.xml file. --> - + diff --git a/Essentials/nbproject/build-impl.xml b/Essentials/nbproject/build-impl.xml index abe3504c1..6aa5e7272 100644 --- a/Essentials/nbproject/build-impl.xml +++ b/Essentials/nbproject/build-impl.xml @@ -601,13 +601,6 @@ is divided into following sections: - - - - - - - @@ -1044,13 +1037,6 @@ is divided into following sections: - - - - - - - diff --git a/Essentials/nbproject/genfiles.properties b/Essentials/nbproject/genfiles.properties index 6854e9131..bd84a7be1 100644 --- a/Essentials/nbproject/genfiles.properties +++ b/Essentials/nbproject/genfiles.properties @@ -3,8 +3,8 @@ build.xml.script.CRC32=3233ee78 build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=5b04d165 -nbproject/build-impl.xml.script.CRC32=685f55e4 +nbproject/build-impl.xml.data.CRC32=4b596d89 +nbproject/build-impl.xml.script.CRC32=4926001b nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 nbproject/profiler-build-impl.xml.data.CRC32=ab78ce15 nbproject/profiler-build-impl.xml.script.CRC32=abda56ed diff --git a/Essentials/nbproject/project.properties b/Essentials/nbproject/project.properties index 47a285424..0f92879ab 100644 --- a/Essentials/nbproject/project.properties +++ b/Essentials/nbproject/project.properties @@ -22,11 +22,14 @@ debug.test.classpath=\ ${run.test.classpath} # This directory is removed when the project is cleaned: dist.dir=dist -dist.jar=${dist.dir}/original-Essentials.jar +dist.jar=${dist.dir}/Essentials.jar dist.javadoc.dir=${dist.dir}/javadoc endorsed.classpath= excludes= +file.reference.BOSEconomy.jar=../lib/BOSEconomy.jar file.reference.craftbukkit-0.0.1-SNAPSHOT.jar=..\\lib\\craftbukkit-0.0.1-SNAPSHOT.jar +file.reference.iCo4.jar=../lib/iCo4.jar +file.reference.iCo5.jar=../lib/iCo5.jar file.reference.junit-4.5.jar=..\\lib\\junit_4\\junit-4.5.jar file.reference.Permissions.jar=..\\lib\\Permissions.jar includes=** @@ -34,7 +37,9 @@ jar.compress=false javac.classpath=\ ${file.reference.Permissions.jar}:\ ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\ - ${reference.Register.jar} + ${file.reference.BOSEconomy.jar}:\ + ${file.reference.iCo4.jar}:\ + ${file.reference.iCo5.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -62,8 +67,6 @@ javadoc.windowtitle= meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform -project.Register=../Register -reference.Register.jar=${project.Register}/dist/Register.jar run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/Essentials/nbproject/project.xml b/Essentials/nbproject/project.xml index b49d94afe..354722f09 100644 --- a/Essentials/nbproject/project.xml +++ b/Essentials/nbproject/project.xml @@ -14,15 +14,6 @@ ../lib/nblibraries.properties - - - Register - jar - - jar - clean - jar - - + diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index e9f0871ab..053b1ab41 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -26,7 +26,7 @@ import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import com.earth2me.essentials.commands.IEssentialsCommand; import com.earth2me.essentials.commands.NotEnoughArgumentsException; -import com.essentials.register.payment.Methods; +import com.earth2me.essentials.register.payment.Methods; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.bukkit.command.PluginCommand; diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 5613ffe49..8fe2b0ec5 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -1,7 +1,7 @@ package com.earth2me.essentials; import com.earth2me.essentials.commands.IEssentialsCommand; -import com.essentials.register.payment.Method; +import com.earth2me.essentials.register.payment.Method; import java.util.Calendar; import java.util.GregorianCalendar; import java.util.logging.Logger; diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Method.java b/Essentials/src/com/earth2me/essentials/register/payment/Method.java new file mode 100644 index 000000000..cb2c3eef7 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/register/payment/Method.java @@ -0,0 +1,48 @@ +package com.earth2me.essentials.register.payment; + +public interface Method { + public Object getPlugin(); + public String getName(); + public String getVersion(); + public String format(double amount); + public boolean hasBanks(); + public boolean hasBank(String bank); + public boolean hasAccount(String name); + public boolean hasBankAccount(String bank, String name); + public MethodAccount getAccount(String name); + public MethodBankAccount getBankAccount(String bank, String name); + + public interface MethodAccount { + public double balance(); + public boolean add(double amount); + public boolean subtract(double amount); + public boolean multiply(double amount); + public boolean divide(double amount); + public boolean hasEnough(double amount); + public boolean hasOver(double amount); + public boolean hasUnder(double amount); + public boolean isNegative(); + public boolean remove(); + + @Override + public String toString(); + } + + public interface MethodBankAccount { + public double balance(); + public String getBankName(); + public int getBankId(); + public boolean add(double amount); + public boolean subtract(double amount); + public boolean multiply(double amount); + public boolean divide(double amount); + public boolean hasEnough(double amount); + public boolean hasOver(double amount); + public boolean hasUnder(double amount); + public boolean isNegative(); + public boolean remove(); + + @Override + public String toString(); + } +} diff --git a/Essentials/src/com/earth2me/essentials/register/payment/MethodBOSEconomy.java b/Essentials/src/com/earth2me/essentials/register/payment/MethodBOSEconomy.java new file mode 100644 index 000000000..c9f40ce0f --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/register/payment/MethodBOSEconomy.java @@ -0,0 +1,180 @@ +package com.earth2me.essentials.register.payment; + +import cosine.boseconomy.BOSEconomy; + +public class MethodBOSEconomy implements Method { + private BOSEconomy BOSEconomy; + + public MethodBOSEconomy(BOSEconomy BOSEconomy) { + this.BOSEconomy = BOSEconomy; + } + + public BOSEconomy getPlugin() { + return this.BOSEconomy; + } + + public String getName() { + return "BOSEconomy"; + } + + public String getVersion() { + return "0.6.2"; + } + + public String format(double amount) { + String currency = this.BOSEconomy.getMoneyNamePlural(); + if(amount == 1) currency = this.BOSEconomy.getMoneyName(); + return amount + " " + currency; + } + + public boolean hasBanks() { + return true; + } + + public boolean hasBank(String bank) { + return this.BOSEconomy.bankExists(bank); + } + + public boolean hasAccount(String name) { + return this.BOSEconomy.playerRegistered(name, false); + } + + public boolean hasBankAccount(String bank, String name) { + return this.BOSEconomy.isBankOwner(bank, name); + } + + public MethodAccount getAccount(String name) { + if(!hasAccount(name)) return null; + return new BOSEAccount(name, this.BOSEconomy); + } + + public MethodBankAccount getBankAccount(String bank, String name) { + return new BOSEBankAccount(bank, name, BOSEconomy); + } + + public class BOSEAccount implements MethodAccount { + private String name; + private BOSEconomy BOSEconomy; + + public BOSEAccount(String name, BOSEconomy bOSEconomy) { + this.name = name; + this.BOSEconomy = bOSEconomy; + } + + public double balance() { + return Double.valueOf(this.BOSEconomy.getPlayerMoney(this.name)); + } + + public boolean add(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.addPlayerMoney(this.name, IntAmount, false); + } + + public boolean subtract(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.setPlayerMoney(this.name, (balance - IntAmount), false); + } + + public boolean multiply(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.setPlayerMoney(this.name, (balance * IntAmount), false); + } + + public boolean divide(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.setPlayerMoney(this.name, (balance / IntAmount), false); + } + + public boolean hasEnough(double amount) { + return (this.balance() >= amount); + } + + public boolean hasOver(double amount) { + return (this.balance() > amount); + } + + public boolean hasUnder(double amount) { + return (this.balance() < amount); + } + + public boolean isNegative() { + return (this.balance() < 0); + } + + public boolean remove() { + return false; + } + } + + public class BOSEBankAccount implements MethodBankAccount { + private String bank; + private String name; + private BOSEconomy BOSEconomy; + + public BOSEBankAccount(String bank, String name, BOSEconomy bOSEconomy) { + this.name = name; + this.bank = bank; + this.BOSEconomy = bOSEconomy; + } + + public String getBankName() { + return this.bank; + } + + public int getBankId() { + return -1; + } + + public double balance() { + return Double.valueOf(this.BOSEconomy.getBankMoney(name)); + } + + public boolean add(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.setBankMoney(this.name, (balance + IntAmount), false); + } + + public boolean subtract(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.setBankMoney(this.name, (balance - IntAmount), false); + } + + public boolean multiply(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.setBankMoney(this.name, (balance * IntAmount), false); + } + + public boolean divide(double amount) { + int IntAmount = (int)Math.ceil(amount); + int balance = (int)this.balance(); + return this.BOSEconomy.setBankMoney(this.name, (balance / IntAmount), false); + } + + public boolean hasEnough(double amount) { + return (this.balance() >= amount); + } + + public boolean hasOver(double amount) { + return (this.balance() > amount); + } + + public boolean hasUnder(double amount) { + return (this.balance() < amount); + } + + public boolean isNegative() { + return (this.balance() < 0); + } + + public boolean remove() { + return this.BOSEconomy.removeBank(bank); + } + } +} \ No newline at end of file diff --git a/Essentials/src/com/earth2me/essentials/register/payment/MethodiCo4.java b/Essentials/src/com/earth2me/essentials/register/payment/MethodiCo4.java new file mode 100644 index 000000000..8bb8567d2 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/register/payment/MethodiCo4.java @@ -0,0 +1,114 @@ +package com.earth2me.essentials.register.payment; + +import com.nijiko.coelho.iConomy.iConomy; +import com.nijiko.coelho.iConomy.system.Account; + +public class MethodiCo4 implements Method { + private iConomy iConomy; + + public MethodiCo4(iConomy iConomy) { + this.iConomy = iConomy; + } + + public iConomy getPlugin() { + return this.iConomy; + } + + public String getName() { + return "iConomy"; + } + + public String getVersion() { + return "4"; + } + + public String format(double amount) { + return this.iConomy.getBank().format(amount); + } + + public boolean hasBanks() { + return false; + } + + public boolean hasBank(String bank) { + return false; + } + + public boolean hasAccount(String name) { + return this.iConomy.getBank().hasAccount(name); + } + + public boolean hasBankAccount(String bank, String name) { + return false; + } + + public MethodAccount getAccount(String name) { + return new iCoAccount(this.iConomy.getBank().getAccount(name)); + } + + public MethodBankAccount getBankAccount(String bank, String name) { + return null; + } + + public class iCoAccount implements MethodAccount { + private Account account; + + public iCoAccount(Account account) { + this.account = account; + } + + public Account getiCoAccount() { + return account; + } + + public double balance() { + return this.account.getBalance(); + } + + public boolean add(double amount) { + if(this.account == null) return false; + this.account.add(amount); + return true; + } + + public boolean subtract(double amount) { + if(this.account == null) return false; + this.account.subtract(amount); + return true; + } + + public boolean multiply(double amount) { + if(this.account == null) return false; + this.account.multiply(amount); + return true; + } + + public boolean divide(double amount) { + if(this.account == null) return false; + this.account.divide(amount); + return true; + } + + public boolean hasEnough(double amount) { + return this.account.hasEnough(amount); + } + + public boolean hasOver(double amount) { + return this.account.hasOver(amount); + } + + public boolean hasUnder(double amount) { + return (this.balance() < amount); + } + + public boolean isNegative() { + return this.account.isNegative(); + } + + public boolean remove() { + if(this.account == null) return false; + this.account.remove(); + return true; + } + } +} diff --git a/Essentials/src/com/earth2me/essentials/register/payment/MethodiCo5.java b/Essentials/src/com/earth2me/essentials/register/payment/MethodiCo5.java new file mode 100644 index 000000000..38a32e205 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/register/payment/MethodiCo5.java @@ -0,0 +1,191 @@ +package com.earth2me.essentials.register.payment; + +import com.iConomy.iConomy; +import com.iConomy.system.Account; +import com.iConomy.system.BankAccount; +import com.iConomy.system.Holdings; +import com.iConomy.util.Constants; + +public class MethodiCo5 implements Method { + private iConomy iConomy; + + public MethodiCo5(iConomy iConomy) { + this.iConomy = iConomy; + } + + public iConomy getPlugin() { + return this.iConomy; + } + + public String getName() { + return "iConomy"; + } + + public String getVersion() { + return "5"; + } + + public String format(double amount) { + return this.iConomy.format(amount); + } + + public boolean hasBanks() { + return Constants.Banking; + } + + public boolean hasBank(String bank) { + return (!hasBanks()) ? false : this.iConomy.Banks.exists(bank); + } + + public boolean hasAccount(String name) { + return this.iConomy.hasAccount(name); + } + + public boolean hasBankAccount(String bank, String name) { + return (hasBank(bank)) ? false : this.iConomy.getBank(name).hasAccount(name); + } + + public MethodAccount getAccount(String name) { + return new iCoAccount(this.iConomy.getAccount(name)); + } + + public MethodBankAccount getBankAccount(String bank, String name) { + return new iCoBankAccount(this.iConomy.getBank(bank).getAccount(name)); + } + + public class iCoAccount implements MethodAccount { + private Account account; + private Holdings holdings; + + public iCoAccount(Account account) { + this.account = account; + this.holdings = account.getHoldings(); + } + + public Account getiCoAccount() { + return account; + } + + public double balance() { + return this.holdings.balance(); + } + + public boolean add(double amount) { + if(this.holdings == null) return false; + this.holdings.add(amount); + return true; + } + + public boolean subtract(double amount) { + if(this.holdings == null) return false; + this.holdings.subtract(amount); + return true; + } + + public boolean multiply(double amount) { + if(this.holdings == null) return false; + this.holdings.multiply(amount); + return true; + } + + public boolean divide(double amount) { + if(this.holdings == null) return false; + this.holdings.divide(amount); + return true; + } + + public boolean hasEnough(double amount) { + return this.holdings.hasEnough(amount); + } + + public boolean hasOver(double amount) { + return this.holdings.hasOver(amount); + } + + public boolean hasUnder(double amount) { + return this.holdings.hasUnder(amount); + } + + public boolean isNegative() { + return this.holdings.isNegative(); + } + + public boolean remove() { + if(this.account == null) return false; + this.account.remove(); + return true; + } + } + + public class iCoBankAccount implements MethodBankAccount { + private BankAccount account; + private Holdings holdings; + + public iCoBankAccount(BankAccount account) { + this.account = account; + this.holdings = account.getHoldings(); + } + + public BankAccount getiCoBankAccount() { + return account; + } + + public String getBankName() { + return this.account.getBankName(); + } + + public int getBankId() { + return this.account.getBankId(); + } + + public double balance() { + return this.holdings.balance(); + } + + public boolean add(double amount) { + if(this.holdings == null) return false; + this.holdings.add(amount); + return true; + } + + public boolean subtract(double amount) { + if(this.holdings == null) return false; + this.holdings.subtract(amount); + return true; + } + + public boolean multiply(double amount) { + if(this.holdings == null) return false; + this.holdings.multiply(amount); + return true; + } + + public boolean divide(double amount) { + if(this.holdings == null) return false; + this.holdings.divide(amount); + return true; + } + + public boolean hasEnough(double amount) { + return this.holdings.hasEnough(amount); + } + + public boolean hasOver(double amount) { + return this.holdings.hasOver(amount); + } + + public boolean hasUnder(double amount) { + return this.holdings.hasUnder(amount); + } + + public boolean isNegative() { + return this.holdings.isNegative(); + } + + public boolean remove() { + if(this.account == null) return false; + this.account.remove(); + return true; + } + } +} diff --git a/Essentials/src/com/earth2me/essentials/register/payment/Methods.java b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java new file mode 100644 index 000000000..36be5bce8 --- /dev/null +++ b/Essentials/src/com/earth2me/essentials/register/payment/Methods.java @@ -0,0 +1,70 @@ +package com.earth2me.essentials.register.payment; + +import com.iConomy.iConomy; +import cosine.boseconomy.BOSEconomy; + +import org.bukkit.plugin.Plugin; +import org.bukkit.plugin.PluginManager; +import org.bukkit.plugin.PluginDescriptionFile; + +public class Methods { + private Method Method = null; + public Plugin method = null; + + public boolean setMethod(Plugin method) { + PluginManager loader = method.getServer().getPluginManager(); + + if(method.isEnabled()) { + PluginDescriptionFile info = method.getDescription(); + String name = info.getName(); + + if(name.equalsIgnoreCase("iconomy")) { + if(method.getClass().getName().equals("com.iConomy.iConomy")) + Method = new MethodiCo5((iConomy)method); + else { Method = new MethodiCo4((com.nijiko.coelho.iConomy.iConomy)method); } + } else if(name.equalsIgnoreCase("boseconomy")) { + Method = new MethodBOSEconomy((BOSEconomy)method); + } + } + + if(!hasMethod()) { + if(loader.getPlugin("iConomy") != null) { + method = loader.getPlugin("iConomy"); + if(method.getClass().getName().equals("com.iConomy.iConomy")) + Method = new MethodiCo5((iConomy)method); + else { Method = new MethodiCo4((com.nijiko.coelho.iConomy.iConomy)method); } + } else if(loader.getPlugin("BOSEconomy") != null) { + method = loader.getPlugin("BOSEconomy"); + Method = new MethodBOSEconomy((BOSEconomy)method); + } + } + + return hasMethod(); + } + + public boolean checkDisabled(Plugin method) { + PluginDescriptionFile info = method.getDescription(); + String name = info.getName(); + + if(name.equalsIgnoreCase("iconomy")) { + if(method.getClass().getName().equals("com.iConomy.iConomy")) + Method = null; + else { Method = null; } + } else if(name.equalsIgnoreCase("boseconomy")) { + Method = null; + } else if(name.equalsIgnoreCase("essentials")) { + Method = null; + } + + return (Method == null); + } + + public boolean hasMethod() { + return (Method != null); + } + + public Method getMethod() { + return Method; + } + +} diff --git a/EssentialsChat/nbproject/build-impl.xml b/EssentialsChat/nbproject/build-impl.xml index e29ddc780..84fb4835f 100644 --- a/EssentialsChat/nbproject/build-impl.xml +++ b/EssentialsChat/nbproject/build-impl.xml @@ -608,13 +608,6 @@ is divided into following sections: - - - - - - - @@ -1058,13 +1051,6 @@ is divided into following sections: - - - - - - - diff --git a/EssentialsChat/nbproject/genfiles.properties b/EssentialsChat/nbproject/genfiles.properties index 4cd2c5511..49f0e1c6b 100644 --- a/EssentialsChat/nbproject/genfiles.properties +++ b/EssentialsChat/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=71afd555 build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=3869278d -nbproject/build-impl.xml.script.CRC32=2a1bb0f3 +nbproject/build-impl.xml.data.CRC32=7c7f517b +nbproject/build-impl.xml.script.CRC32=9d5d3374 nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 diff --git a/EssentialsChat/nbproject/project.properties b/EssentialsChat/nbproject/project.properties index 09ad86fb8..89b368bee 100644 --- a/EssentialsChat/nbproject/project.properties +++ b/EssentialsChat/nbproject/project.properties @@ -33,8 +33,7 @@ jar.compress=false javac.classpath=\ ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\ ${file.reference.Permissions.jar}:\ - ${reference.Essentials.jar}:\ - ${reference.Register.jar} + ${reference.Essentials.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -64,9 +63,7 @@ meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform project.Essentials=../Essentials -project.Register=../Register reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar -reference.Register.jar=${project.Register}/dist/Register.jar run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/EssentialsChat/nbproject/project.xml b/EssentialsChat/nbproject/project.xml index bd945a361..993881f29 100644 --- a/EssentialsChat/nbproject/project.xml +++ b/EssentialsChat/nbproject/project.xml @@ -23,14 +23,6 @@ clean jar - - Register - jar - - jar - clean - jar - diff --git a/EssentialsGeoIP/nbproject/build-impl.xml b/EssentialsGeoIP/nbproject/build-impl.xml index a381fd143..b32699fc0 100644 --- a/EssentialsGeoIP/nbproject/build-impl.xml +++ b/EssentialsGeoIP/nbproject/build-impl.xml @@ -608,13 +608,6 @@ is divided into following sections: - - - - - - - @@ -1058,13 +1051,6 @@ is divided into following sections: - - - - - - - diff --git a/EssentialsGeoIP/nbproject/genfiles.properties b/EssentialsGeoIP/nbproject/genfiles.properties index eecf3b548..3bb0e69c6 100644 --- a/EssentialsGeoIP/nbproject/genfiles.properties +++ b/EssentialsGeoIP/nbproject/genfiles.properties @@ -1,8 +1,8 @@ -build.xml.data.CRC32=51dc0823 +build.xml.data.CRC32=cbf94f59 build.xml.script.CRC32=c4b1bb0e build.xml.stylesheet.CRC32=28e38971@1.43.1.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=51dc0823 -nbproject/build-impl.xml.script.CRC32=ebe82412 +nbproject/build-impl.xml.data.CRC32=cbf94f59 +nbproject/build-impl.xml.script.CRC32=a87d6c0a nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 diff --git a/EssentialsGeoIP/nbproject/project.properties b/EssentialsGeoIP/nbproject/project.properties index 5a3bd1294..ed96af206 100644 --- a/EssentialsGeoIP/nbproject/project.properties +++ b/EssentialsGeoIP/nbproject/project.properties @@ -30,8 +30,7 @@ includes=** jar.compress=false javac.classpath=\ ${reference.Essentials.jar}:\ - ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\ - ${reference.Register.jar} + ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -63,9 +62,7 @@ meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform project.Essentials=../Essentials -project.Register=../Register reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar -reference.Register.jar=${project.Register}/dist/Register.jar run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/EssentialsGeoIP/nbproject/project.xml b/EssentialsGeoIP/nbproject/project.xml index fd1a5628b..2c6cc9d84 100644 --- a/EssentialsGeoIP/nbproject/project.xml +++ b/EssentialsGeoIP/nbproject/project.xml @@ -23,14 +23,6 @@ clean jar - - Register - jar - - jar - clean - jar - diff --git a/EssentialsProtect/nbproject/build-impl.xml b/EssentialsProtect/nbproject/build-impl.xml index 95424134e..e69131a5a 100644 --- a/EssentialsProtect/nbproject/build-impl.xml +++ b/EssentialsProtect/nbproject/build-impl.xml @@ -608,13 +608,6 @@ is divided into following sections: - - - - - - - @@ -1058,13 +1051,6 @@ is divided into following sections: - - - - - - - diff --git a/EssentialsProtect/nbproject/genfiles.properties b/EssentialsProtect/nbproject/genfiles.properties index 8b5d3b093..663396f31 100644 --- a/EssentialsProtect/nbproject/genfiles.properties +++ b/EssentialsProtect/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=1ed11cc3 build.xml.stylesheet.CRC32=28e38971@1.38.3.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=672252fb -nbproject/build-impl.xml.script.CRC32=663029e3 +nbproject/build-impl.xml.data.CRC32=40644caa +nbproject/build-impl.xml.script.CRC32=0a5523ea nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 diff --git a/EssentialsProtect/nbproject/project.properties b/EssentialsProtect/nbproject/project.properties index f0325deb7..8d0c349b8 100644 --- a/EssentialsProtect/nbproject/project.properties +++ b/EssentialsProtect/nbproject/project.properties @@ -35,8 +35,7 @@ jar.index=${jnlp.enabled} javac.classpath=\ ${reference.Essentials.jar}:\ ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\ - ${file.reference.c3p0-0.9.1.2.jar}:\ - ${reference.Register.jar} + ${file.reference.c3p0-0.9.1.2.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -72,9 +71,7 @@ manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF platform.active=default_platform project.Essentials=../Essentials -project.Register=../Register reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar -reference.Register.jar=${project.Register}/dist/Register.jar run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/EssentialsProtect/nbproject/project.xml b/EssentialsProtect/nbproject/project.xml index 735cb2d60..a3b64021d 100644 --- a/EssentialsProtect/nbproject/project.xml +++ b/EssentialsProtect/nbproject/project.xml @@ -23,14 +23,6 @@ clean jar - - Register - jar - - jar - clean - jar - diff --git a/EssentialsSpawn/nbproject/build-impl.xml b/EssentialsSpawn/nbproject/build-impl.xml index 8fcbe06c2..45fdb295f 100644 --- a/EssentialsSpawn/nbproject/build-impl.xml +++ b/EssentialsSpawn/nbproject/build-impl.xml @@ -608,13 +608,6 @@ is divided into following sections: - - - - - - - @@ -1058,13 +1051,6 @@ is divided into following sections: - - - - - - - diff --git a/EssentialsSpawn/nbproject/genfiles.properties b/EssentialsSpawn/nbproject/genfiles.properties index d03ea7e54..9bef3562d 100644 --- a/EssentialsSpawn/nbproject/genfiles.properties +++ b/EssentialsSpawn/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=46e3642f build.xml.stylesheet.CRC32=28e38971@1.38.2.45 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=0f78c9d4 -nbproject/build-impl.xml.script.CRC32=8deb03d2 +nbproject/build-impl.xml.data.CRC32=e7b96939 +nbproject/build-impl.xml.script.CRC32=f7b05a7b nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 diff --git a/EssentialsSpawn/nbproject/project.properties b/EssentialsSpawn/nbproject/project.properties index d89976025..3b7354449 100644 --- a/EssentialsSpawn/nbproject/project.properties +++ b/EssentialsSpawn/nbproject/project.properties @@ -31,8 +31,7 @@ includes=** jar.compress=false javac.classpath=\ ${reference.Essentials.jar}:\ - ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar}:\ - ${reference.Register.jar} + ${file.reference.craftbukkit-0.0.1-SNAPSHOT.jar} # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false @@ -61,9 +60,7 @@ javadoc.windowtitle= meta.inf.dir=${src.dir}/META-INF platform.active=default_platform project.Essentials=../Essentials -project.Register=../Register reference.Essentials.jar=${project.Essentials}/dist/Essentials.jar -reference.Register.jar=${project.Register}/dist/Register.jar run.classpath=\ ${javac.classpath}:\ ${build.classes.dir} diff --git a/EssentialsSpawn/nbproject/project.xml b/EssentialsSpawn/nbproject/project.xml index 505abb44f..f4e7a570a 100644 --- a/EssentialsSpawn/nbproject/project.xml +++ b/EssentialsSpawn/nbproject/project.xml @@ -23,14 +23,6 @@ clean jar - - Register - jar - - jar - clean - jar - diff --git a/Register/README b/Register/README deleted file mode 100644 index 84f8166d5..000000000 --- a/Register/README +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Register - Bukkit Economy API for all Major Economies - * - * @author: Nijikokun - * @copyright: Copyright (C) 2011 - * @license: GNUv3 Affero License - */ \ No newline at end of file diff --git a/Register/build.xml b/Register/build.xml deleted file mode 100644 index 230fa8618..000000000 --- a/Register/build.xml +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - - - - Builds, tests, and runs the project Register. - - - diff --git a/Register/manifest.mf b/Register/manifest.mf deleted file mode 100644 index 328e8e5bc..000000000 --- a/Register/manifest.mf +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -X-COMMENT: Main-Class will be added automatically by build - diff --git a/Register/nbproject/build-impl.xml b/Register/nbproject/build-impl.xml deleted file mode 100644 index 3eb58c7c3..000000000 --- a/Register/nbproject/build-impl.xml +++ /dev/null @@ -1,1066 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set src.dir - Must set test.src.dir - Must set build.dir - Must set dist.dir - Must set build.classes.dir - Must set dist.javadoc.dir - Must set build.test.classes.dir - Must set build.test.results.dir - Must set build.classes.excludes - Must set dist.jar - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must set JVM to use for profiling in profiler.info.jvm - Must set profiler agent JVM arguments in profiler.info.jvmargs.agent - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - - - - - - java -cp "${run.classpath.with.dist.jar}" ${main.class} - - - - - - - - - - - - - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - java -jar "${dist.jar.resolved}" - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set run.class - - - - Must select one file in the IDE or set run.class - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set debug.class - - - - - Must select one file in the IDE or set debug.class - - - - - Must set fix.includes - - - - - - - - - - - - - - - - - Must select one file in the IDE or set profile.class - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select some files in the IDE or set javac.includes - - - - - - - - - - - - - - - - - - - - Some tests failed; see details above. - - - - - - - - - Must select some files in the IDE or set test.includes - - - - Some tests failed; see details above. - - - - - Must select one file in the IDE or set test.class - - - - - - - - - - - - - - - - - - - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - Must select one file in the IDE or set applet.url - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Register/nbproject/genfiles.properties b/Register/nbproject/genfiles.properties deleted file mode 100644 index 5c88cb356..000000000 --- a/Register/nbproject/genfiles.properties +++ /dev/null @@ -1,8 +0,0 @@ -build.xml.data.CRC32=daedca43 -build.xml.script.CRC32=51c04dce -build.xml.stylesheet.CRC32=28e38971@1.43.1.45 -# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. -# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=daedca43 -nbproject/build-impl.xml.script.CRC32=bdb937ac -nbproject/build-impl.xml.stylesheet.CRC32=0c01fd8e@1.43.1.45 diff --git a/Register/nbproject/project.properties b/Register/nbproject/project.properties deleted file mode 100644 index 6e6ae5f2a..000000000 --- a/Register/nbproject/project.properties +++ /dev/null @@ -1,80 +0,0 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.run.all.processors=true -annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output -application.title=Register -application.vendor=schlex -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -# This directory is removed when the project is cleaned: -build.dir=build -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -# Uncomment to specify the preferred debugger connection transport: -#debug.transport=dt_socket -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -# This directory is removed when the project is cleaned: -dist.dir=dist -dist.jar=${dist.dir}/Register.jar -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -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.iCo4.jar=../lib/iCo4.jar -file.reference.iCo5.jar=../lib/iCo5.jar -includes=** -jar.compress=false -javac.classpath=\ - ${file.reference.bukkit-0.0.1-SNAPSHOT.jar}:\ - ${file.reference.BOSEconomy.jar}:\ - ${file.reference.iCo4.jar}:\ - ${file.reference.iCo5.jar} -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.processorpath=\ - ${javac.classpath} -javac.source=1.6 -javac.target=1.6 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -javac.test.processorpath=\ - ${javac.test.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding=${source.encoding} -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -main.class= -manifest.file=manifest.mf -meta.inf.dir=${src.dir}/META-INF -mkdist.disabled=false -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value -# or test-sys-prop.name=value to set system properties for unit tests): -run.jvmargs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -source.encoding=UTF-8 -src.dir=src -test.src.dir=test diff --git a/Register/nbproject/project.xml b/Register/nbproject/project.xml deleted file mode 100644 index 4e27755e8..000000000 --- a/Register/nbproject/project.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - org.netbeans.modules.java.j2seproject - - - Register - - - - - - - - - ../lib/nblibraries.properties - - - diff --git a/Register/src/com/essentials/register/payment/Method.java b/Register/src/com/essentials/register/payment/Method.java deleted file mode 100644 index cc0182877..000000000 --- a/Register/src/com/essentials/register/payment/Method.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.essentials.register.payment; - -public interface Method { - public Object getPlugin(); - public String getName(); - public String getVersion(); - public String format(double amount); - public boolean hasBanks(); - public boolean hasBank(String bank); - public boolean hasAccount(String name); - public boolean hasBankAccount(String bank, String name); - public MethodAccount getAccount(String name); - public MethodBankAccount getBankAccount(String bank, String name); - - public interface MethodAccount { - public double balance(); - public boolean add(double amount); - public boolean subtract(double amount); - public boolean multiply(double amount); - public boolean divide(double amount); - public boolean hasEnough(double amount); - public boolean hasOver(double amount); - public boolean hasUnder(double amount); - public boolean isNegative(); - public boolean remove(); - - @Override - public String toString(); - } - - public interface MethodBankAccount { - public double balance(); - public String getBankName(); - public int getBankId(); - public boolean add(double amount); - public boolean subtract(double amount); - public boolean multiply(double amount); - public boolean divide(double amount); - public boolean hasEnough(double amount); - public boolean hasOver(double amount); - public boolean hasUnder(double amount); - public boolean isNegative(); - public boolean remove(); - - @Override - public String toString(); - } -} diff --git a/Register/src/com/essentials/register/payment/MethodBOSEconomy.java b/Register/src/com/essentials/register/payment/MethodBOSEconomy.java deleted file mode 100644 index 1e67156e6..000000000 --- a/Register/src/com/essentials/register/payment/MethodBOSEconomy.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.essentials.register.payment; - -import cosine.boseconomy.BOSEconomy; - -public class MethodBOSEconomy implements Method { - private BOSEconomy BOSEconomy; - - public MethodBOSEconomy(BOSEconomy BOSEconomy) { - this.BOSEconomy = BOSEconomy; - } - - public BOSEconomy getPlugin() { - return this.BOSEconomy; - } - - public String getName() { - return "BOSEconomy"; - } - - public String getVersion() { - return "0.6.2"; - } - - public String format(double amount) { - String currency = this.BOSEconomy.getMoneyNamePlural(); - if(amount == 1) currency = this.BOSEconomy.getMoneyName(); - return amount + " " + currency; - } - - public boolean hasBanks() { - return true; - } - - public boolean hasBank(String bank) { - return this.BOSEconomy.bankExists(bank); - } - - public boolean hasAccount(String name) { - return this.BOSEconomy.playerRegistered(name, false); - } - - public boolean hasBankAccount(String bank, String name) { - return this.BOSEconomy.isBankOwner(bank, name); - } - - public MethodAccount getAccount(String name) { - if(!hasAccount(name)) return null; - return new BOSEAccount(name, this.BOSEconomy); - } - - public MethodBankAccount getBankAccount(String bank, String name) { - return new BOSEBankAccount(bank, name, BOSEconomy); - } - - public class BOSEAccount implements MethodAccount { - private String name; - private BOSEconomy BOSEconomy; - - public BOSEAccount(String name, BOSEconomy bOSEconomy) { - this.name = name; - this.BOSEconomy = bOSEconomy; - } - - public double balance() { - return Double.valueOf(this.BOSEconomy.getPlayerMoney(this.name)); - } - - public boolean add(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.addPlayerMoney(this.name, IntAmount, false); - } - - public boolean subtract(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.setPlayerMoney(this.name, (balance - IntAmount), false); - } - - public boolean multiply(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.setPlayerMoney(this.name, (balance * IntAmount), false); - } - - public boolean divide(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.setPlayerMoney(this.name, (balance / IntAmount), false); - } - - public boolean hasEnough(double amount) { - return (this.balance() >= amount); - } - - public boolean hasOver(double amount) { - return (this.balance() > amount); - } - - public boolean hasUnder(double amount) { - return (this.balance() < amount); - } - - public boolean isNegative() { - return (this.balance() < 0); - } - - public boolean remove() { - return false; - } - } - - public class BOSEBankAccount implements MethodBankAccount { - private String bank; - private String name; - private BOSEconomy BOSEconomy; - - public BOSEBankAccount(String bank, String name, BOSEconomy bOSEconomy) { - this.name = name; - this.bank = bank; - this.BOSEconomy = bOSEconomy; - } - - public String getBankName() { - return this.bank; - } - - public int getBankId() { - return -1; - } - - public double balance() { - return Double.valueOf(this.BOSEconomy.getBankMoney(name)); - } - - public boolean add(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.setBankMoney(this.name, (balance + IntAmount), false); - } - - public boolean subtract(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.setBankMoney(this.name, (balance - IntAmount), false); - } - - public boolean multiply(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.setBankMoney(this.name, (balance * IntAmount), false); - } - - public boolean divide(double amount) { - int IntAmount = (int)Math.ceil(amount); - int balance = (int)this.balance(); - return this.BOSEconomy.setBankMoney(this.name, (balance / IntAmount), false); - } - - public boolean hasEnough(double amount) { - return (this.balance() >= amount); - } - - public boolean hasOver(double amount) { - return (this.balance() > amount); - } - - public boolean hasUnder(double amount) { - return (this.balance() < amount); - } - - public boolean isNegative() { - return (this.balance() < 0); - } - - public boolean remove() { - return this.BOSEconomy.removeBank(bank); - } - } -} \ No newline at end of file diff --git a/Register/src/com/essentials/register/payment/MethodiCo4.java b/Register/src/com/essentials/register/payment/MethodiCo4.java deleted file mode 100644 index 42c80c3bc..000000000 --- a/Register/src/com/essentials/register/payment/MethodiCo4.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.essentials.register.payment; - -import com.nijiko.coelho.iConomy.iConomy; -import com.nijiko.coelho.iConomy.system.Account; - -public class MethodiCo4 implements Method { - private iConomy iConomy; - - public MethodiCo4(iConomy iConomy) { - this.iConomy = iConomy; - } - - public iConomy getPlugin() { - return this.iConomy; - } - - public String getName() { - return "iConomy"; - } - - public String getVersion() { - return "4"; - } - - public String format(double amount) { - return this.iConomy.getBank().format(amount); - } - - public boolean hasBanks() { - return false; - } - - public boolean hasBank(String bank) { - return false; - } - - public boolean hasAccount(String name) { - return this.iConomy.getBank().hasAccount(name); - } - - public boolean hasBankAccount(String bank, String name) { - return false; - } - - public MethodAccount getAccount(String name) { - return new iCoAccount(this.iConomy.getBank().getAccount(name)); - } - - public MethodBankAccount getBankAccount(String bank, String name) { - return null; - } - - public class iCoAccount implements MethodAccount { - private Account account; - - public iCoAccount(Account account) { - this.account = account; - } - - public Account getiCoAccount() { - return account; - } - - public double balance() { - return this.account.getBalance(); - } - - public boolean add(double amount) { - if(this.account == null) return false; - this.account.add(amount); - return true; - } - - public boolean subtract(double amount) { - if(this.account == null) return false; - this.account.subtract(amount); - return true; - } - - public boolean multiply(double amount) { - if(this.account == null) return false; - this.account.multiply(amount); - return true; - } - - public boolean divide(double amount) { - if(this.account == null) return false; - this.account.divide(amount); - return true; - } - - public boolean hasEnough(double amount) { - return this.account.hasEnough(amount); - } - - public boolean hasOver(double amount) { - return this.account.hasOver(amount); - } - - public boolean hasUnder(double amount) { - return (this.balance() < amount); - } - - public boolean isNegative() { - return this.account.isNegative(); - } - - public boolean remove() { - if(this.account == null) return false; - this.account.remove(); - return true; - } - } -} diff --git a/Register/src/com/essentials/register/payment/MethodiCo5.java b/Register/src/com/essentials/register/payment/MethodiCo5.java deleted file mode 100644 index c1634fcb5..000000000 --- a/Register/src/com/essentials/register/payment/MethodiCo5.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.essentials.register.payment; - -import com.iConomy.iConomy; -import com.iConomy.system.Account; -import com.iConomy.system.BankAccount; -import com.iConomy.system.Holdings; -import com.iConomy.util.Constants; - -public class MethodiCo5 implements Method { - private iConomy iConomy; - - public MethodiCo5(iConomy iConomy) { - this.iConomy = iConomy; - } - - public iConomy getPlugin() { - return this.iConomy; - } - - public String getName() { - return "iConomy"; - } - - public String getVersion() { - return "5"; - } - - public String format(double amount) { - return this.iConomy.format(amount); - } - - public boolean hasBanks() { - return Constants.Banking; - } - - public boolean hasBank(String bank) { - return (!hasBanks()) ? false : this.iConomy.Banks.exists(bank); - } - - public boolean hasAccount(String name) { - return this.iConomy.hasAccount(name); - } - - public boolean hasBankAccount(String bank, String name) { - return (hasBank(bank)) ? false : this.iConomy.getBank(name).hasAccount(name); - } - - public MethodAccount getAccount(String name) { - return new iCoAccount(this.iConomy.getAccount(name)); - } - - public MethodBankAccount getBankAccount(String bank, String name) { - return new iCoBankAccount(this.iConomy.getBank(bank).getAccount(name)); - } - - public class iCoAccount implements MethodAccount { - private Account account; - private Holdings holdings; - - public iCoAccount(Account account) { - this.account = account; - this.holdings = account.getHoldings(); - } - - public Account getiCoAccount() { - return account; - } - - public double balance() { - return this.holdings.balance(); - } - - public boolean add(double amount) { - if(this.holdings == null) return false; - this.holdings.add(amount); - return true; - } - - public boolean subtract(double amount) { - if(this.holdings == null) return false; - this.holdings.subtract(amount); - return true; - } - - public boolean multiply(double amount) { - if(this.holdings == null) return false; - this.holdings.multiply(amount); - return true; - } - - public boolean divide(double amount) { - if(this.holdings == null) return false; - this.holdings.divide(amount); - return true; - } - - public boolean hasEnough(double amount) { - return this.holdings.hasEnough(amount); - } - - public boolean hasOver(double amount) { - return this.holdings.hasOver(amount); - } - - public boolean hasUnder(double amount) { - return this.holdings.hasUnder(amount); - } - - public boolean isNegative() { - return this.holdings.isNegative(); - } - - public boolean remove() { - if(this.account == null) return false; - this.account.remove(); - return true; - } - } - - public class iCoBankAccount implements MethodBankAccount { - private BankAccount account; - private Holdings holdings; - - public iCoBankAccount(BankAccount account) { - this.account = account; - this.holdings = account.getHoldings(); - } - - public BankAccount getiCoBankAccount() { - return account; - } - - public String getBankName() { - return this.account.getBankName(); - } - - public int getBankId() { - return this.account.getBankId(); - } - - public double balance() { - return this.holdings.balance(); - } - - public boolean add(double amount) { - if(this.holdings == null) return false; - this.holdings.add(amount); - return true; - } - - public boolean subtract(double amount) { - if(this.holdings == null) return false; - this.holdings.subtract(amount); - return true; - } - - public boolean multiply(double amount) { - if(this.holdings == null) return false; - this.holdings.multiply(amount); - return true; - } - - public boolean divide(double amount) { - if(this.holdings == null) return false; - this.holdings.divide(amount); - return true; - } - - public boolean hasEnough(double amount) { - return this.holdings.hasEnough(amount); - } - - public boolean hasOver(double amount) { - return this.holdings.hasOver(amount); - } - - public boolean hasUnder(double amount) { - return this.holdings.hasUnder(amount); - } - - public boolean isNegative() { - return this.holdings.isNegative(); - } - - public boolean remove() { - if(this.account == null) return false; - this.account.remove(); - return true; - } - } -} diff --git a/Register/src/com/essentials/register/payment/Methods.java b/Register/src/com/essentials/register/payment/Methods.java deleted file mode 100644 index f47eecb55..000000000 --- a/Register/src/com/essentials/register/payment/Methods.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.essentials.register.payment; - -import com.iConomy.iConomy; -import cosine.boseconomy.BOSEconomy; - -import org.bukkit.plugin.Plugin; -import org.bukkit.plugin.PluginManager; -import org.bukkit.plugin.PluginDescriptionFile; - -public class Methods { - private Method Method = null; - public Plugin method = null; - - public boolean setMethod(Plugin method) { - PluginManager loader = method.getServer().getPluginManager(); - - if(method.isEnabled()) { - PluginDescriptionFile info = method.getDescription(); - String name = info.getName(); - - if(name.equalsIgnoreCase("iconomy")) { - if(method.getClass().getName().equals("com.iConomy.iConomy")) - Method = new MethodiCo5((iConomy)method); - else { Method = new MethodiCo4((com.nijiko.coelho.iConomy.iConomy)method); } - } else if(name.equalsIgnoreCase("boseconomy")) { - Method = new MethodBOSEconomy((BOSEconomy)method); - } - } - - if(!hasMethod()) { - if(loader.getPlugin("iConomy") != null) { - method = loader.getPlugin("iConomy"); - if(method.getClass().getName().equals("com.iConomy.iConomy")) - Method = new MethodiCo5((iConomy)method); - else { Method = new MethodiCo4((com.nijiko.coelho.iConomy.iConomy)method); } - } else if(loader.getPlugin("BOSEconomy") != null) { - method = loader.getPlugin("BOSEconomy"); - Method = new MethodBOSEconomy((BOSEconomy)method); - } - } - - return hasMethod(); - } - - public boolean checkDisabled(Plugin method) { - PluginDescriptionFile info = method.getDescription(); - String name = info.getName(); - - if(name.equalsIgnoreCase("iconomy")) { - if(method.getClass().getName().equals("com.iConomy.iConomy")) - Method = null; - else { Method = null; } - } else if(name.equalsIgnoreCase("boseconomy")) { - Method = null; - } else if(name.equalsIgnoreCase("essentials")) { - Method = null; - } - - return (Method == null); - } - - public boolean hasMethod() { - return (Method != null); - } - - public Method getMethod() { - return Method; - } - -} -- cgit v1.2.3