-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update add method for StatType in TranslationBuilder #4143
base: 1.21.1
Are you sure you want to change the base?
Update add method for StatType in TranslationBuilder #4143
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error? not sure how the translation would be used if the name is not TTC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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