From 3eff30a4be8b8b301c24c3e12ffb842939d46a1a Mon Sep 17 00:00:00 2001 From: Len <40720638+destro174@users.noreply.github.com> Date: Sat, 8 Oct 2022 11:14:58 +0200 Subject: [PATCH] Update permissions for nickcommand. --- .../com/alttd/chat/nicknames/Nicknames.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/galaxy/src/main/java/com/alttd/chat/nicknames/Nicknames.java b/galaxy/src/main/java/com/alttd/chat/nicknames/Nicknames.java index 99f779a..552c9c0 100644 --- a/galaxy/src/main/java/com/alttd/chat/nicknames/Nicknames.java +++ b/galaxy/src/main/java/com/alttd/chat/nicknames/Nicknames.java @@ -130,23 +130,23 @@ public class Nicknames implements CommandExecutor, TabCompleter { @Override public List onTabComplete(CommandSender sender, @NotNull Command command, @NotNull String label, String[] args) { List completions = new ArrayList<>(); - if (!sender.hasPermission("utility.nick")) return completions; + if (!sender.hasPermission("chat.command.nick")) return completions; if (args.length == 1) { List choices = new ArrayList<>(); - if (sender.hasPermission("utility.nick.set")) { + if (sender.hasPermission("chat.command.nick.set")) { choices.add("set"); } - if (sender.hasPermission("utility.nick.review")) { + if (sender.hasPermission("chat.command.nick.review")) { choices.add("review"); } - if (sender.hasPermission("utility.nick.request")) { + if (sender.hasPermission("chat.command.nick.request")) { choices.add("request"); } - if (sender.hasPermission("utility.nick.try")) { + if (sender.hasPermission("chat.command.nick.try")) { choices.add("try"); } - if (sender.hasPermission("utility.nick.current")) { + if (sender.hasPermission("chat.command.nick.current")) { choices.add("current"); } choices.add("help"); @@ -162,7 +162,7 @@ public class Nicknames implements CommandExecutor, TabCompleter { List onlinePlayers = new ArrayList<>(); Bukkit.getOnlinePlayers().forEach(a -> onlinePlayers.add(a.getName())); - if (sender.hasPermission("utility.nick.set.others")) { + if (sender.hasPermission("chat.command.nick.set.others")) { choices.addAll(onlinePlayers); } @@ -188,7 +188,7 @@ public class Nicknames implements CommandExecutor, TabCompleter { Nick nick = NickCache.get(uniqueId); long timeSinceLastChange = new Date().getTime() - nick.getLastChangedDate(); long waitTime = Config.NICK_WAIT_TIME; - if (timeSinceLastChange > waitTime || player.hasPermission("utility.nick.admin")) { + if (timeSinceLastChange > waitTime || player.hasPermission("chat.command.nick.bypasswaittime")) { if (nick.hasRequest()) { player.sendMessage(Utility.parseMiniMessage(Config.NICK_REQUEST_PLACED, Placeholder.component("oldrequestednick", Utility.applyColor(nick.getNewNick())), @@ -341,28 +341,28 @@ public class Nicknames implements CommandExecutor, TabCompleter { message.append(helpMessage(sender, HelpType.TRY)); break; case SET_SELF: - if (sender.hasPermission("utility.nick.set")) { + if (sender.hasPermission("chat.command.nick.set")) { message.append("/nick set - Sets your nickname to the specified name.\n"); } break; case SET_OTHERS: - if (sender.hasPermission("utility.nick.set.others")) { + if (sender.hasPermission("chat.command.nick.set.others")) { message.append("/nick set - Sets the specified user's nickname to the specified name.\n"); } break; case REQUEST: - if (sender.hasPermission("utility.nick.request")) { + if (sender.hasPermission("chat.command.nick.request")) { message.append("/nick request - Requests a username to be reviewed by staff.\n" + " Try using /nick try to see if you like the name, you can only change it once per day!\n"); } break; case REVIEW: - if (sender.hasPermission("utility.nick.review")) { + if (sender.hasPermission("chat.command.nick.review")) { message.append("/nick review - Opens the nickname review GUI (left click to accept a nick, right click to deny it)\n"); } break; case TRY: - if (sender.hasPermission("utility.nick.try")) { + if (sender.hasPermission("chat.command.nick.try")) { message.append("/nick try - Shows you what your nickname will look like in chat.\n"); } }