diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-10 19:44:12 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-04-10 19:44:12 +0000 |
commit | 017e2082314927756488db93c9279e19dc8bd5df (patch) | |
tree | a0d2636660599f4b70694baccb88a5102438c516 | |
parent | affa1dd652fc8d46f1188d349a1bd84c25833fed (diff) | |
download | Essentials-017e2082314927756488db93c9279e19dc8bd5df.tar Essentials-017e2082314927756488db93c9279e19dc8bd5df.tar.gz Essentials-017e2082314927756488db93c9279e19dc8bd5df.tar.lz Essentials-017e2082314927756488db93c9279e19dc8bd5df.tar.xz Essentials-017e2082314927756488db93c9279e19dc8bd5df.zip |
[trunk] New permissions:
essentials.nocommandcost.all
essentials.nocommandcost.[commandname]
Don't charge a user for a command.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1165 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/User.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index f1641406d..66a452541 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -7,7 +7,6 @@ import org.bukkit.*; import com.earth2me.essentials.commands.IEssentialsCommand; import net.minecraft.server.EntityHuman; import org.bukkit.command.CommandSender; -import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.entity.*; import org.bukkit.inventory.ItemStack; import org.yaml.snakeyaml.Yaml; @@ -337,6 +336,10 @@ public class User extends PlayerExtension implements Comparable<User>, IReplyTo public void charge(String cmd) throws Exception { + if (isAuthorized("essentials.nocommandcost.all") || + isAuthorized("essentials.nocommandcost."+cmd)) { + return; + } double mon = getMoney(); double cost = Essentials.getSettings().getCommandCost(cmd.startsWith("/") ? cmd.substring(1) : cmd); if (mon < cost && !isOp()) |