mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-21 07:59: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
|
@Override
|
||||||
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) {
|
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String @NotNull [] args) {
|
||||||
boolean silent = false;
|
boolean silent = false;
|
||||||
|
boolean console = false;
|
||||||
|
|
||||||
|
if (!(sender instanceof Player)) {
|
||||||
|
console = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.length == 0) {
|
if (args.length == 0) {
|
||||||
if (!(sender instanceof Player)) {
|
if (console) {
|
||||||
// Console
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!sender.hasPermission("hmccosmetics.cmd.default")) {
|
if (!sender.hasPermission("hmccosmetics.cmd.default")) {
|
||||||
@@ -140,7 +144,7 @@ public class CosmeticCommand implements CommandExecutor {
|
|||||||
|
|
||||||
CosmeticUser user = CosmeticUsers.getUser(player);
|
CosmeticUser user = CosmeticUsers.getUser(player);
|
||||||
|
|
||||||
if (!user.canEquipCosmetic(cosmetic)) {
|
if (!user.canEquipCosmetic(cosmetic) && !console) {
|
||||||
if (!silent) MessagesUtil.sendMessage(player, "no-cosmetic-permission");
|
if (!silent) MessagesUtil.sendMessage(player, "no-cosmetic-permission");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user