Update permissions for nickcommand. V2
This commit is contained in:
parent
3eff30a4be
commit
e811b0ca9a
|
|
@ -52,9 +52,9 @@ public class Nicknames implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
switch (args[0].toLowerCase()) {
|
switch (args[0].toLowerCase()) {
|
||||||
case "set":
|
case "set":
|
||||||
if (args.length == 2 && hasPermission(sender, "utility.nick.set")) {
|
if (args.length == 2 && hasPermission(sender, "chat.command.nick.set")) {
|
||||||
handleNick(player, player, args[1]);
|
handleNick(player, player, args[1]);
|
||||||
} else if (args.length == 3 && hasPermission(sender, "utility.nick.set.others")) {
|
} else if (args.length == 3 && hasPermission(sender, "chat.command.nick.set.others")) {
|
||||||
OfflinePlayer offlinePlayer = sender.getServer().getOfflinePlayer(args[1]);
|
OfflinePlayer offlinePlayer = sender.getServer().getOfflinePlayer(args[1]);
|
||||||
|
|
||||||
if (offlinePlayer.isOnline() || offlinePlayer.hasPlayedBefore()) {
|
if (offlinePlayer.isOnline() || offlinePlayer.hasPlayedBefore()) {
|
||||||
|
|
@ -67,7 +67,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "review":
|
case "review":
|
||||||
if (args.length == 1 && hasPermission(sender, "utility.nick.review")) {
|
if (args.length == 1 && hasPermission(sender, "chat.command.nick.review")) {
|
||||||
NicknamesGui nicknamesGui = new NicknamesGui();
|
NicknamesGui nicknamesGui = new NicknamesGui();
|
||||||
ChatPlugin.getInstance().getServer().getPluginManager().registerEvents(nicknamesGui, ChatPlugin.getInstance());
|
ChatPlugin.getInstance().getServer().getPluginManager().registerEvents(nicknamesGui, ChatPlugin.getInstance());
|
||||||
nicknamesGui.openInventory(player);
|
nicknamesGui.openInventory(player);
|
||||||
|
|
@ -76,7 +76,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "request":
|
case "request":
|
||||||
if (args.length == 2 && hasPermission(sender, "utility.nick.request")) {
|
if (args.length == 2 && hasPermission(sender, "chat.command.nick.request")) {
|
||||||
new BukkitRunnable() {
|
new BukkitRunnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
@ -88,7 +88,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "try":
|
case "try":
|
||||||
if (args.length == 2 && hasPermission(sender, "utility.nick.try")) {
|
if (args.length == 2 && hasPermission(sender, "chat.command.nick.try")) {
|
||||||
LuckPerms api = ChatAPI.get().getLuckPerms();
|
LuckPerms api = ChatAPI.get().getLuckPerms();
|
||||||
if (api != null) {
|
if (api != null) {
|
||||||
if (NickUtilities.validNick(player, player, args[1])) {
|
if (NickUtilities.validNick(player, player, args[1])) {
|
||||||
|
|
@ -105,7 +105,7 @@ public class Nicknames implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "current":
|
case "current":
|
||||||
if (hasPermission(sender, "utility.nick.current")) {
|
if (hasPermission(sender, "chat.command.nick.current")) {
|
||||||
ChatUser chatUser = ChatUserManager.getChatUser(player.getUniqueId());
|
ChatUser chatUser = ChatUserManager.getChatUser(player.getUniqueId());
|
||||||
TagResolver placeholders = TagResolver.resolver(
|
TagResolver placeholders = TagResolver.resolver(
|
||||||
Placeholder.component("nickname", chatUser.getDisplayName()),
|
Placeholder.component("nickname", chatUser.getDisplayName()),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user