mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-21 16:09:27 +00:00
perf: avoid creating unnecessary collection copies
This commit is contained in:
@@ -194,7 +194,7 @@ public class CosmeticUser implements CosmeticHolder {
|
|||||||
|
|
||||||
this.updateCosmetic();
|
this.updateCosmetic();
|
||||||
|
|
||||||
if(isHidden() && !getUserEmoteManager().isPlayingEmote() && !getCosmetics().isEmpty()) {
|
if(isHidden() && !getUserEmoteManager().isPlayingEmote() && !playerCosmetics.isEmpty()) {
|
||||||
MessagesUtil.sendActionBar(getPlayer(), "hidden-cosmetics");
|
MessagesUtil.sendActionBar(getPlayer(), "hidden-cosmetics");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -632,7 +632,7 @@ public class CosmeticUser implements CosmeticHolder {
|
|||||||
public List<CosmeticSlot> getDyeableSlots() {
|
public List<CosmeticSlot> getDyeableSlots() {
|
||||||
ArrayList<CosmeticSlot> dyableSlots = new ArrayList<>();
|
ArrayList<CosmeticSlot> dyableSlots = new ArrayList<>();
|
||||||
|
|
||||||
for (Cosmetic cosmetic : getCosmetics()) {
|
for (Cosmetic cosmetic : playerCosmetics.values()) {
|
||||||
if (cosmetic.isDyable()) dyableSlots.add(cosmetic.getSlot());
|
if (cosmetic.isDyable()) dyableSlots.add(cosmetic.getSlot());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user