summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/User.java
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-22 18:53:23 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-22 18:53:23 +0000
commit5ae48481bd230051407bf4d33f23a1fadd652b21 (patch)
treed1eb13610af2ff4ba114f879d570ff96a0e57969 /Essentials/src/com/earth2me/essentials/User.java
parent011fc09b4f3a52da091b13d9f7a454898c4499c0 (diff)
downloadEssentials-5ae48481bd230051407bf4d33f23a1fadd652b21.tar
Essentials-5ae48481bd230051407bf4d33f23a1fadd652b21.tar.gz
Essentials-5ae48481bd230051407bf4d33f23a1fadd652b21.tar.lz
Essentials-5ae48481bd230051407bf4d33f23a1fadd652b21.tar.xz
Essentials-5ae48481bd230051407bf4d33f23a1fadd652b21.zip
Refactoring: New Charge class
user.canAfford(String), user.canAfford(EssentialsCommand), user.charge(String), user.charge(EssentialsCommand) have been removed. Teleport class has been changed to use the Charge class. This also fixes some bugs, like the one with warp signs. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1512 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/User.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/User.java36
1 files changed, 0 insertions, 36 deletions
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java
index 26279171f..c8ef473c0 100644
--- a/Essentials/src/com/earth2me/essentials/User.java
+++ b/Essentials/src/com/earth2me/essentials/User.java
@@ -117,32 +117,6 @@ public class User extends UserData implements Comparable<User>, IReplyTo
sendMessage(Util.format("takenFromAccount", Util.formatCurrency(value)));
}
- public void charge(String cmd) throws Exception
- {
- if (isAuthorized("essentials.nocommandcost.all")
- || isAuthorized("essentials.nocommandcost." + cmd))
- {
- return;
- }
- double mon = getMoney();
- double cost = ess.getSettings().getCommandCost(cmd.startsWith("/") ? cmd.substring(1) : cmd);
- if (mon < cost && !isAuthorized("essentials.eco.loan"))
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- takeMoney(cost);
- }
-
- public void canAfford(String cmd) throws Exception
- {
- double mon = getMoney();
- double cost = ess.getSettings().getCommandCost(cmd.startsWith("/") ? cmd.substring(1) : cmd);
- if (mon < cost && !isAuthorized("essentials.eco.loan"))
- {
- throw new Exception(Util.i18n("notEnoughMoney"));
- }
- }
-
public boolean canAfford(double cost)
{
double mon = getMoney();
@@ -156,21 +130,11 @@ public class User extends UserData implements Comparable<User>, IReplyTo
}
}
- public void canAfford(IEssentialsCommand cmd) throws Exception
- {
- canAfford(cmd.getName());
- }
-
public void dispose()
{
this.base = new OfflinePlayer(getName());
}
- public void charge(IEssentialsCommand cmd) throws Exception
- {
- charge(cmd.getName());
- }
-
public boolean getJustPortaled()
{
return justPortaled;