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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user