summaryrefslogtreecommitdiffstats
path: root/EssentialsiConomyBridge/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'EssentialsiConomyBridge/src/com')
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java25
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java35
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java147
-rw-r--r--EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java56
4 files changed, 0 insertions, 263 deletions
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java
deleted file mode 100644
index f01e686bf..000000000
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/existCheck.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.nijiko.coelho.iConomy;
-
-import java.util.logging.Logger;
-import org.bukkit.Bukkit;
-
-
-public class existCheck
-{
- private static final Logger logger = Logger.getLogger("Minecraft");
- //We have to make sure the user exists!
- public static boolean exist(String name)
- {
-
- if (name == null)
- {
- logger.info("Essentials iConomy Bridge - Whatever plugin is calling for users that are null is BROKEN!");
- return false;
- }
- if (Bukkit.getServer().getPlayer(name) != null)
- {
- return true;
- }
- return false;
- }
-} \ No newline at end of file
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java
deleted file mode 100644
index 648b27378..000000000
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/iConomy.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.nijiko.coelho.iConomy;
-
-import com.nijiko.coelho.iConomy.system.Bank;
-import java.util.logging.Logger;
-import org.bukkit.plugin.java.JavaPlugin;
-
-
-/**
- * This is not iConomy and I take NO credit for iConomy!
- * This is FayConomy, a iConomy Essentials Eco bridge!
- * @author Xeology
- */
-
-public class iConomy extends JavaPlugin{
- public static Bank Bank = new Bank();
- private static final Logger logger = Logger.getLogger("Minecraft");
-
- //Fake bank
- public static Bank getBank()
- {
- return Bank;
- }
-
- @Override
- public void onDisable()
- {
-
- }
-
- @Override
- public void onEnable()
- {
- logger.info("Essentials iConomy Bridge is now activated!!");
- }
-}
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
deleted file mode 100644
index a4a48b2ca..000000000
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java
+++ /dev/null
@@ -1,147 +0,0 @@
-package com.nijiko.coelho.iConomy.system;
-
-import com.earth2me.essentials.api.Economy;
-import com.nijiko.coelho.iConomy.existCheck;
-
-
-public class Account
-{
- private String name;
-
- public String getName()
- {
- return name;
- }
-
- /**
- * Essentials does not support hidden accounts.
- * @return false
- */
- public boolean setHidden(boolean hidden)
- {
- return true;
- }
-
- //Simply set the account variable type?
- public Account(String name)
- {
- this.name = name;
- }
-
- public double getBalance()
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- return Economy.getMoney(name);
- }
- return 0;
- }
- return Economy.getMoney(name);
- }
-
- public void setBalance(double bal)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.setMoney(name, bal);
- }
- return;
- }
- Economy.setMoney(name, bal);
- }
-
- public void add(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.add(name, money);
- }
- return;
- }
- Economy.add(name, money);
- }
-
- public void divide(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.divide(name, money);
- }
- return;
- }
- Economy.divide(name, money);
- }
-
- public void multiply(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.multiply(name, money);
- }
- return;
- }
- Economy.multiply(name, money);
- }
-
- public void subtract(double money)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.subtract(name, money);
- }
- return;
- }
- Economy.subtract(name, money);
- }
-
- public void resetBalance()
- {
- this.setBalance(0);
- }
-
- public boolean hasEnough(double amount)
- {
- return amount <= this.getBalance();
- }
-
- public boolean hasOver(double amount)
- {
- return amount < this.getBalance();
- }
-
- /**
- * Essentials does not support hidden accounts.
- * @return false
- */
- public boolean isHidden()
- {
- return false;
- }
-
- public boolean isNegative()
- {
- return this.getBalance() < 0.0;
- }
-
- /**
- * Because some plugins like to use depricated methods I must save
- * admins' log from the overflow of dumb
- */
- @Deprecated
- public void save()
- {
- }
-;
-}
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java
deleted file mode 100644
index 54e8e6387..000000000
--- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Bank.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package com.nijiko.coelho.iConomy.system;
-
-import com.earth2me.essentials.api.Economy;
-import com.nijiko.coelho.iConomy.existCheck;
-
-
-public class Bank
-{
- //The fake formatter
- public String format(double amount)
- {
- return Economy.format(amount);
- }
-
- //Fake currency!
- public String getCurrency()
- {
- return Economy.getCurrency();
- }
-
- //Fake "does player have an account?" but essentials eco doesnt need to make one, so TRUE, unless its an NPC.
- public boolean hasAccount(String account)
- {
- if (!existCheck.exist(account))
- {
- if (!Economy.accountExist(account))
- {
- Economy.newAccount(account);
- }
- }
- return true;
- }
-
- //simply switches the name to an account type?
- public Account getAccount(String name)
- {
- Account Account = null;
- Account = new Account(name);
- hasAccount(name);
- return Account;
- }
-
- //Fake remove account
- public void removeAccount(String name)
- {
- if (!existCheck.exist(name))
- {
- if (Economy.accountExist(name))
- {
- Economy.removeAccount(name);
- }
- return;
- }
- Economy.setMoney(name, 0);
- }
-}