From 1e6734bf6f4f04f944dc160a0800edfe92cf13de Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Thu, 24 Oct 2024 20:34:17 -0500 Subject: [PATCH] feat: console can now apply any cosmetic to a player --- .../hmccosmetics/command/CosmeticCommand.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 7a18f1aa..a14dc81a 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/command/CosmeticCommand.java @@ -43,10 +43,14 @@ public class CosmeticCommand implements CommandExecutor { @Override public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) { boolean silent = false; + boolean console = false; + + if (!(sender instanceof Player)) { + console = true; + } if (args.length == 0) { - if (!(sender instanceof Player)) { - // Console + if (console) { return true; } if (!sender.hasPermission("hmccosmetics.cmd.default")) { @@ -140,7 +144,7 @@ public class CosmeticCommand implements CommandExecutor { CosmeticUser user = CosmeticUsers.getUser(player); - if (!user.canEquipCosmetic(cosmetic)) { + if (!user.canEquipCosmetic(cosmetic) && !console) { if (!silent) MessagesUtil.sendMessage(player, "no-cosmetic-permission"); return true; }