diff --git a/build.gradle.kts b/build.gradle.kts index 28324d1a..02a3f460 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -190,11 +190,14 @@ bukkit { register("hmccosmetics.cmd.menu") { default = BukkitPluginDescription.Permission.Default.TRUE } + register("hmccosmetics.emote.shiftrun") { + default = BukkitPluginDescription.Permission.Default.TRUE + } register("hmccosmetics.cmd.emote") { default = BukkitPluginDescription.Permission.Default.TRUE } - register("hmccosmetics.emote.shiftrun") { - default = BukkitPluginDescription.Permission.Default.TRUE + register("hmccosmetics.cmd.emote.other") { + default = BukkitPluginDescription.Permission.Default.OP } register("hmccosmetics.cmd.setlocation") { default = BukkitPluginDescription.Permission.Default.OP diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java index de74dc66..6a1a3ed7 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java @@ -386,6 +386,9 @@ public class CosmeticCommand implements CommandExecutor { if (!silent) MessagesUtil.sendMessage(sender, "no-permission"); return true; } + if (sender.hasPermission("hmccosmetics.cmd.emote.other")) { + if (args.length >= 2) player = Bukkit.getPlayer(args[1]); + } CosmeticUser user = CosmeticUsers.getUser(player); if (!user.hasCosmeticInSlot(CosmeticSlot.EMOTE)) { if (!silent) MessagesUtil.sendMessage(sender, "emote-none"); diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java index ebc1b814..a922fa7a 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommandTabComplete.java @@ -40,6 +40,7 @@ public class CosmeticCommandTabComplete implements TabCompleter { if (hasPermission(sender, "hmccosmetics.cmd.hide")) completions.add("hide"); if (hasPermission(sender, "hmccosmetics.cmd.show")) completions.add("show"); if (hasPermission(sender, "hmccosmetics.cmd.debug")) completions.add("debug"); + if (hasPermission(sender, "hmccosmetics.cmd.emote")) completions.add("emote"); StringUtil.copyPartialMatches(args[0], completions, finalCompletitons); } @@ -63,7 +64,7 @@ public class CosmeticCommandTabComplete implements TabCompleter { if (menu.canOpen(user.getPlayer())) completions.add(menu.getId()); } } - case "dataclear", "wardrobe", "hide", "show" -> { + case "dataclear", "wardrobe", "hide", "show", "emote" -> { for (Player player : Bukkit.getOnlinePlayers()) { completions.add(player.getName()); } @@ -78,9 +79,6 @@ public class CosmeticCommandTabComplete implements TabCompleter { completions.add("viewerlocation"); completions.add("leavelocation"); } - case "emote" -> { - completions.addAll(PlayerAnimator.api.getAnimationManager().getRegistry().keySet()); - } } StringUtil.copyPartialMatches(args[1], completions, finalCompletitons); }