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

perf: avoid creating unnecessary collection copies

This commit is contained in:
yusshu
2025-03-10 19:48:30 -05:00
parent f5a01c0104
commit 76429ed041

View File

@@ -194,7 +194,7 @@ public class CosmeticUser implements CosmeticHolder {
this.updateCosmetic();
if(isHidden() && !getUserEmoteManager().isPlayingEmote() && !getCosmetics().isEmpty()) {
if(isHidden() && !getUserEmoteManager().isPlayingEmote() && !playerCosmetics.isEmpty()) {
MessagesUtil.sendActionBar(getPlayer(), "hidden-cosmetics");
}
}
@@ -632,7 +632,7 @@ public class CosmeticUser implements CosmeticHolder {
public List<CosmeticSlot> getDyeableSlots() {
ArrayList<CosmeticSlot> dyableSlots = new ArrayList<>();
for (Cosmetic cosmetic : getCosmetics()) {
for (Cosmetic cosmetic : playerCosmetics.values()) {
if (cosmetic.isDyable()) dyableSlots.add(cosmetic.getSlot());
}