mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-19 15:09:19 +00:00
command improvements + /cosmetic emote playerName
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user