diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/NounsCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/NounsCommand.java index 3dd1b7b..b9d35a9 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/NounsCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/NounsCommand.java @@ -1,11 +1,15 @@ package wtf.beatrice.nounspicker.commands; +import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import wtf.beatrice.nounspicker.NounsPicker; import wtf.beatrice.nounspicker.commands.subcommands.*; +import wtf.beatrice.nounspicker.objects.Permission; +import wtf.beatrice.nounspicker.utils.Cache; +import wtf.beatrice.nounspicker.utils.PermissionManager; public class NounsCommand implements CommandExecutor { @@ -23,9 +27,15 @@ public class NounsCommand implements CommandExecutor @NotNull String[] args) { + if(!PermissionManager.hasPermission(sender, Permission.NOUNS_BASE)) + { + sender.sendMessage(Cache.noPermissions); + return true; + } + if(args.length == 0) { - sender.sendMessage("Please specify an argument!"); + sender.sendMessage(ChatColor.RED + "Please, specify an argument!"); return true; } diff --git a/src/main/java/wtf/beatrice/nounspicker/objects/Permission.java b/src/main/java/wtf/beatrice/nounspicker/objects/Permission.java index 2be3d06..b653a1b 100644 --- a/src/main/java/wtf/beatrice/nounspicker/objects/Permission.java +++ b/src/main/java/wtf/beatrice/nounspicker/objects/Permission.java @@ -2,11 +2,12 @@ package wtf.beatrice.nounspicker.objects; public enum Permission { - NOUNS_SET("nouns.set"), - NOUNS_LIST("nouns.list"), - NOUNS_CREATE("nouns.create"), - NOUNS_DELETE("nouns.delete"), - NOUNS_UPDATE("nouns.update"); + NOUNS_BASE("nouns.base"), + NOUNS_SET("nouns.cmd.set"), + NOUNS_LIST("nouns.cmd.list"), + NOUNS_CREATE("nouns.cmd.create"), + NOUNS_DELETE("nouns.cmd.delete"), + NOUNS_UPDATE("nouns.cmd.update"); private String perm;