Add base command permission, update perm nodes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Bea 2022-10-24 22:52:55 +02:00
parent fb128d2e26
commit 9acb7a222d
2 changed files with 17 additions and 6 deletions

View File

@ -1,11 +1,15 @@
package wtf.beatrice.nounspicker.commands; package wtf.beatrice.nounspicker.commands;
import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import wtf.beatrice.nounspicker.NounsPicker; import wtf.beatrice.nounspicker.NounsPicker;
import wtf.beatrice.nounspicker.commands.subcommands.*; 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 public class NounsCommand implements CommandExecutor
{ {
@ -23,9 +27,15 @@ public class NounsCommand implements CommandExecutor
@NotNull String[] args) @NotNull String[] args)
{ {
if(!PermissionManager.hasPermission(sender, Permission.NOUNS_BASE))
{
sender.sendMessage(Cache.noPermissions);
return true;
}
if(args.length == 0) if(args.length == 0)
{ {
sender.sendMessage("Please specify an argument!"); sender.sendMessage(ChatColor.RED + "Please, specify an argument!");
return true; return true;
} }

View File

@ -2,11 +2,12 @@ package wtf.beatrice.nounspicker.objects;
public enum Permission { public enum Permission {
NOUNS_SET("nouns.set"), NOUNS_BASE("nouns.base"),
NOUNS_LIST("nouns.list"), NOUNS_SET("nouns.cmd.set"),
NOUNS_CREATE("nouns.create"), NOUNS_LIST("nouns.cmd.list"),
NOUNS_DELETE("nouns.delete"), NOUNS_CREATE("nouns.cmd.create"),
NOUNS_UPDATE("nouns.update"); NOUNS_DELETE("nouns.cmd.delete"),
NOUNS_UPDATE("nouns.cmd.update");
private String perm; private String perm;