diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/placeholders/HMCPlaceholderExpansion.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/placeholders/HMCPlaceholderExpansion.java index 40ce6334..07c0b8f1 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/placeholders/HMCPlaceholderExpansion.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/hooks/placeholders/HMCPlaceholderExpansion.java @@ -80,7 +80,7 @@ public class HMCPlaceholderExpansion extends PlaceholderExpansion { if (placeholderArgs.get(1) != null) { CosmeticSlot slot = CosmeticSlot.valueOf(placeholderArgs.get(1).toUpperCase()); if (slot == null) return null; - if (user.getCosmetic(slot) == null) return null; + if (user.getCosmetic(slot) == null) return "none"; if (placeholderArgs.size() == 2) return user.getCosmetic(slot).getId(); String output; @@ -104,7 +104,7 @@ public class HMCPlaceholderExpansion extends PlaceholderExpansion { output = user.getCosmetic(slot).getId(); } } - return TranslationUtil.getTranslation("current-cosmetic", String.valueOf(output)); + return TranslationUtil.getTranslation("current-cosmetic", output); } case "unlocked": if (placeholderArgs == null) { @@ -216,6 +216,7 @@ public class HMCPlaceholderExpansion extends PlaceholderExpansion { if (!item.hasItemMeta()) return null; ItemMeta itemMeta = item.getItemMeta(); if (itemMeta == null) return null; + if (!itemMeta.hasDisplayName()) return null; return itemMeta.getDisplayName(); } diff --git a/common/src/main/resources/translations.yml b/common/src/main/resources/translations.yml index acb0ef40..9ff141ee 100644 --- a/common/src/main/resources/translations.yml +++ b/common/src/main/resources/translations.yml @@ -11,5 +11,4 @@ using-cosmetic: true: "true" false: "false" current-cosmetic: - true: "true" - false: "false" + none: "none"