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

fix: cosmetic null showing error

This commit is contained in:
LoJoSho
2023-04-22 16:27:05 -05:00
parent d0b4be6db8
commit 36f33b54af

View File

@@ -62,8 +62,9 @@ public class HMCPlaceholderExpansion extends PlaceholderExpansion {
}
if (placeholderArgs.get(1) != null) {
Cosmetic cosmetic = Cosmetics.getCosmetic(placeholderArgs.get(1));
if (cosmetic == null) return "INVALID_COSMETIC";
Cosmetic currentCosmetic = user.getCosmetic(cosmetic.getSlot());
if (cosmetic == null || currentCosmetic == null) return "false";
if (currentCosmetic == null) return "false";
if (currentCosmetic.getId() == cosmetic.getId()) return "true";
return "false";
}