9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-19 15:09:19 +00:00

feat: console can now apply any cosmetic to a player

This commit is contained in:
LoJoSho
2024-10-24 20:34:17 -05:00
parent ad382e5d9e
commit 1e6734bf6f

View File

@@ -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;
}