9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-31 12:56:39 +00:00

offhand does not override existing item

This commit is contained in:
LoJoSho
2023-01-12 12:16:32 -06:00
parent 45ffccebc6
commit 5b0ed5414b

View File

@@ -23,6 +23,9 @@ public class CosmeticArmorType extends Cosmetic {
@Override
public void update(CosmeticUser user) {
Player player = Bukkit.getPlayer(user.getUniqueId());
if (equipSlot.equals(EquipmentSlot.OFF_HAND)) {
if (!player.getInventory().getItemInOffHand().getType().isAir()) return;
}
PacketManager.equipmentSlotUpdate(player, getSlot(), PacketManager.getViewers(player.getLocation()));
}