Add base command permission, update perm nodes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
fb128d2e26
commit
9acb7a222d
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user