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

feat: define no-cosmetic and none differently in translations

This commit is contained in:
LoJoSho
2023-10-15 10:41:45 -05:00
parent 56529d6111
commit 90ad700d0a
2 changed files with 3 additions and 1 deletions

View File

@@ -80,7 +80,7 @@ public class HMCPlaceholderExpansion extends PlaceholderExpansion {
if (placeholderArgs.get(1) != null) { if (placeholderArgs.get(1) != null) {
CosmeticSlot slot = CosmeticSlot.valueOf(placeholderArgs.get(1).toUpperCase()); CosmeticSlot slot = CosmeticSlot.valueOf(placeholderArgs.get(1).toUpperCase());
if (slot == null) return null; if (slot == null) return null;
if (user.getCosmetic(slot) == null) return "none"; if (user.getCosmetic(slot) == null) return TranslationUtil.getTranslation("current-cosmetic", "no-cosmetic");
if (placeholderArgs.size() == 2) return user.getCosmetic(slot).getId(); if (placeholderArgs.size() == 2) return user.getCosmetic(slot).getId();
String output; String output;
@@ -104,6 +104,7 @@ public class HMCPlaceholderExpansion extends PlaceholderExpansion {
output = user.getCosmetic(slot).getId(); output = user.getCosmetic(slot).getId();
} }
} }
if (output == null) output = "none";
return TranslationUtil.getTranslation("current-cosmetic", output); return TranslationUtil.getTranslation("current-cosmetic", output);
} }
case "unlocked": case "unlocked":

View File

@@ -11,4 +11,5 @@ using-cosmetic:
true: "true" true: "true"
false: "false" false: "false"
current-cosmetic: current-cosmetic:
no-cosmetic: "No Cosmetic"
none: "none" none: "none"