mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-03 15:08:18 +01: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:
parent
affa1dd652
commit
017e208231
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user