diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-22 18:53:23 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-22 18:53:23 +0000 |
commit | 805394ff5c86670dbc961f9cac6765ebfb2a1414 (patch) | |
tree | aadcfba5d181eb3e41494335b7ae5c925d63fa19 /EssentialsSpawn/src/com/earth2me | |
parent | fda91f3afc1831489c91231a58803bac799b9d51 (diff) | |
download | Essentials-805394ff5c86670dbc961f9cac6765ebfb2a1414.tar Essentials-805394ff5c86670dbc961f9cac6765ebfb2a1414.tar.gz Essentials-805394ff5c86670dbc961f9cac6765ebfb2a1414.tar.lz Essentials-805394ff5c86670dbc961f9cac6765ebfb2a1414.tar.xz Essentials-805394ff5c86670dbc961f9cac6765ebfb2a1414.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 'EssentialsSpawn/src/com/earth2me')
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java | 2 | ||||
-rw-r--r-- | EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java index 6d2dfc467..a19fa3d9a 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandsetspawn.java @@ -17,7 +17,7 @@ public class Commandsetspawn extends EssentialsCommand @Override public void run(Server server, User user, String commandLabel, String[] args) throws Exception { - user.charge(this); + charge(user); String group = args.length > 0 ? getFinalArg(args, 0) : "default"; Essentials.getSpawn().setSpawn(user.getLocation(), group); user.sendMessage(Util.format("spawnSet", group)); diff --git a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java index 36af5740b..f36b284e3 100644 --- a/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java +++ b/EssentialsSpawn/src/com/earth2me/essentials/spawn/Commandspawn.java @@ -1,5 +1,6 @@ package com.earth2me.essentials.spawn; +import com.earth2me.essentials.Charge; import org.bukkit.Server; import com.earth2me.essentials.Essentials; import com.earth2me.essentials.User; @@ -16,7 +17,8 @@ public class Commandspawn extends EssentialsCommand @Override public void run(Server server, User user, String commandLabel, String[] args) throws Exception { - user.canAfford(this); - user.getTeleport().respawn(Essentials.getSpawn(), this.getName()); + Charge charge = new Charge(this); + charge.isAffordableFor(user); + user.getTeleport().respawn(Essentials.getSpawn(), charge); } } |