diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-02 18:22:17 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-02 18:22:17 +0000 |
commit | 79c0ef69c40643c1cc89c5842a9d0706aeabb390 (patch) | |
tree | 4a5f60607e70e16802f273f73412834e0702b546 /EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java | |
parent | 2af13fd06268842dd42ada707db0e79b67e644d6 (diff) | |
download | Essentials-79c0ef69c40643c1cc89c5842a9d0706aeabb390.tar Essentials-79c0ef69c40643c1cc89c5842a9d0706aeabb390.tar.gz Essentials-79c0ef69c40643c1cc89c5842a9d0706aeabb390.tar.lz Essentials-79c0ef69c40643c1cc89c5842a9d0706aeabb390.tar.xz Essentials-79c0ef69c40643c1cc89c5842a9d0706aeabb390.zip |
Cleanup of the iConomyBridge Code
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1321 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java')
-rw-r--r-- | EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java index 740b31f58..a4a48b2ca 100644 --- a/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java +++ b/EssentialsiConomyBridge/src/com/nijiko/coelho/iConomy/system/Account.java @@ -1,6 +1,6 @@ package com.nijiko.coelho.iConomy.system; -import com.earth2me.essentials.EcoAPI; +import com.earth2me.essentials.api.Economy; import com.nijiko.coelho.iConomy.existCheck; @@ -8,13 +8,15 @@ public class Account { private String name; - //Fake getname public String getName() { return name; } - //Essentials doesnt have hidden accounts so just say yeah whatever! + /** + * Essentials does not support hidden accounts. + * @return false + */ public boolean setHidden(boolean hidden) { return true; @@ -26,122 +28,118 @@ public class Account this.name = name; } - //Fake return balance public double getBalance() { if (!existCheck.exist(name)) { - if (EcoAPI.accountExist(name)) + if (Economy.accountExist(name)) { - return EcoAPI.getMoney(name); + return Economy.getMoney(name); } return 0; } - return EcoAPI.getMoney(name); + return Economy.getMoney(name); } - //Fake Set balance public void setBalance(double bal) { if (!existCheck.exist(name)) { - if (EcoAPI.accountExist(name)) + if (Economy.accountExist(name)) { - EcoAPI.setMoney(name, bal); + Economy.setMoney(name, bal); } return; } - EcoAPI.setMoney(name, bal); + Economy.setMoney(name, bal); } - //Fake add balance public void add(double money) { if (!existCheck.exist(name)) { - if (EcoAPI.accountExist(name)) + if (Economy.accountExist(name)) { - EcoAPI.add(name, money); + Economy.add(name, money); } return; } - EcoAPI.add(name, money); + Economy.add(name, money); } - //Fake divide balance public void divide(double money) { if (!existCheck.exist(name)) { - if (EcoAPI.accountExist(name)) + if (Economy.accountExist(name)) { - EcoAPI.divide(name, money); + Economy.divide(name, money); } return; } - EcoAPI.divide(name, money); + Economy.divide(name, money); } - //Fake multiply balance public void multiply(double money) { if (!existCheck.exist(name)) { - if (EcoAPI.accountExist(name)) + if (Economy.accountExist(name)) { - EcoAPI.multiply(name, money); + Economy.multiply(name, money); } return; } - EcoAPI.multiply(name, money); + Economy.multiply(name, money); } - //Fake subtract balance public void subtract(double money) { if (!existCheck.exist(name)) { - if (EcoAPI.accountExist(name)) + if (Economy.accountExist(name)) { - EcoAPI.subtract(name, money); + Economy.subtract(name, money); } return; } - EcoAPI.subtract(name, money); + Economy.subtract(name, money); } - //fake reset balance! public void resetBalance() { this.setBalance(0); } - //fake bal check public boolean hasEnough(double amount) { return amount <= this.getBalance(); } - //fake another balance check public boolean hasOver(double amount) { return amount < this.getBalance(); } - //Again we dont have hidden accounts here! + /** + * Essentials does not support hidden accounts. + * @return false + */ public boolean isHidden() { return false; } - //Fake is negative check! 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 + /** + * Because some plugins like to use depricated methods I must save + * admins' log from the overflow of dumb + */ + @Deprecated public void save() { } |