summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java12
1 files changed, 3 insertions, 9 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
index c99cdfdc9..58da18c21 100644
--- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
+++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
@@ -79,7 +79,10 @@ public abstract class EssentialsCommand implements IEssentialsCommand
@Override
public final void run(final Server server, final User user, final String commandLabel, final Command cmd, final String[] args) throws Exception
{
+ final Trade charge = new Trade(this.getName(), ess);
+ charge.isAffordableFor(user);
run(server, user, commandLabel, args);
+ charge.charge(user);
}
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
@@ -111,13 +114,4 @@ public abstract class EssentialsCommand implements IEssentialsCommand
}
return bldr.toString();
}
-
- protected void charge(final CommandSender sender) throws ChargeException
- {
- if (sender instanceof Player)
- {
- final Trade charge = new Trade(this.getName(), ess);
- charge.charge(ess.getUser((Player)sender));
- }
- }
}