The-Acronym-Coders / BASE

The Central Repo For The B.A.S.E Project
16 stars 13 forks source link

Address The-Acronym-Coders/ContentTweaker#106 #105

Closed 3TUSK closed 5 years ago

3TUSK commented 6 years ago

This commit does the following:

  1. Change implementation of MaterialPart::getLocalizedName, so that it checks whether the material name is translatable first, and if so, use the translation, otherwise, fallback to Material::getName.
  2. Change implementation of ItemMaterialArmor::getItemStackDisplayName in a similar way to that of what 1. describes.
  3. Change implementation of Material::getUnlocalizedName, to include base.material. prefix. Add Material::getTranslationKey for translatability check in 1. and 2.; it also functions as a pure accessor of translation key of Material.

As mentioned in The-Acronym-Coders/ContentTweaker#106, I18n.canTranslate is not an expensive call, and translated name is only required in places like item tooltip and HUD, so there is no performance issue in this solution.

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.