1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-14 02:24:16 +02:00

[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
This commit is contained in:
snowleo
2011-04-10 19:44:12 +00:00
parent f9d890469d
commit 3a7d092056

View File

@@ -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())