diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java index 896b026..8ca4100 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java @@ -15,8 +15,8 @@ public class NounsCreateSubCommand if(!PermissionManager.hasPermission(sender, Permission.NOUNS_CREATE)) { - sender.sendMessage("No permission!"); - return false; + sender.sendMessage(Cache.noPermissions); + return true; } if(args.length < 3) diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java index 514a7bf..c03f9b8 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java @@ -14,8 +14,8 @@ public class NounsDeleteSubCommand { if(!PermissionManager.hasPermission(sender, Permission.NOUNS_DELETE)) { - sender.sendMessage("No permission!"); - return false; + sender.sendMessage(Cache.noPermissions); + return true; } if(args.length < 2) { diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java index 14872c6..731b84d 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java @@ -16,8 +16,8 @@ public class NounsListSubCommand if(!PermissionManager.hasPermission(sender, Permission.NOUNS_LIST)) { - sender.sendMessage("No permission!"); - return false; + sender.sendMessage(Cache.noPermissions); + return true; } sender.sendMessage("Pronouns List:"); diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java index 11d47b3..1b7b1ef 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java @@ -14,8 +14,8 @@ public class NounsSetSubCommand if(!PermissionManager.hasPermission(sender, Permission.NOUNS_SET)) { - sender.sendMessage("No permission!"); - return false; + sender.sendMessage(Cache.noPermissions); + return true; } if(args.length < 3) diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java index 9ba66ee..d0a8c48 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java @@ -12,11 +12,11 @@ public class NounsUpdateSubCmd public static boolean run(@NotNull CommandSender sender, @NotNull String[] args) { - + if(!PermissionManager.hasPermission(sender, Permission.NOUNS_UPDATE)) { - sender.sendMessage("No permission!"); - return false; + sender.sendMessage(Cache.noPermissions); + return true; } diff --git a/src/main/java/wtf/beatrice/nounspicker/utils/Cache.java b/src/main/java/wtf/beatrice/nounspicker/utils/Cache.java index 1cb3a91..11997d9 100644 --- a/src/main/java/wtf/beatrice/nounspicker/utils/Cache.java +++ b/src/main/java/wtf/beatrice/nounspicker/utils/Cache.java @@ -1,5 +1,6 @@ package wtf.beatrice.nounspicker.utils; +import org.bukkit.ChatColor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -13,4 +14,6 @@ public class Cache public static DatabaseManager dbManager; public static List pronouns = new ArrayList<>(); + + public static String noPermissions = ChatColor.RED + "Sorry, you do not have permissions to use this command!"; }