Fix Material#getTranslationKey for Block Materials (#5294)

* Fix Material#getTranslationKey for Block Materials

* Cache the result of Material#isBlock
This commit is contained in:
Jason Penilla
2021-03-02 16:27:34 -08:00
parent b24a51c0e3
commit b0df4d17c8
2 changed files with 41 additions and 0 deletions

View File

@@ -92,6 +92,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ public String getTranslationKey(Material mat) {
+ if (mat.isBlock()) {
+ return getBlock(mat).getDescriptionId();
+ }
+ return getItem(mat).getOrCreateDescriptionId();
+ }
+