Update add method for StatType in TranslationBuilder#4143
Update add method for StatType in TranslationBuilder#4143solonovamax wants to merge 2 commits intoFabricMC:1.21.1from
Conversation
…anslationKey formatting for StatType
60c45c1 to
a7ac31b
Compare
|
I was originally just going to have the |
|
oopsies, checkstyle issues. I'll fix that in a bit. |
|
but, the issue seems to be my use of spaces over tabs. |
| add("stat_type." + Registries.STAT_TYPE.getId(statType).toString().replace(':', '.'), value); | ||
| if (statType.getName() instanceof TranslatableTextContent translatableTextContent) { | ||
| add(translatableTextContent.getKey(), value); | ||
| } else { // fallback to Util.createTranslationKey formatting (should it error instead?) |
There was a problem hiding this comment.
Error? not sure how the translation would be used if the name is not TTC.
There was a problem hiding this comment.
I just threw in a fallback because you never know, some person might try and have like some string literal concatenated with the translation. But I can always make it an error.
Use either the translation key from the name or fallback to Util.createTranslationKey formatting for StatType in TranslationBuilder