Fix translations for blocks

This commit is contained in:
Draycia committed 2020-09-11 01:53:32 -07:00
1 parent 5ba9f6d08e
commit 6235f30947
1 file changed
+4 -3
@@ -87,9 +87,10 @@ public final class CarbonUtils {
if (itemStack.getItemMeta().hasDisplayName()) {
component.append(TextComponent.fromLegacyText(itemStack.getItemMeta().getDisplayName()));
} else {
final String name = itemStack.getItemMeta().hasDisplayName()
? itemStack.getItemMeta().getDisplayName()
: "item.minecraft." + itemStack.getType().name().toLowerCase(); // As of 1.13, Material is 1:1 with MC's names
// As of 1.13, Material is 1:1 with MC's names
final String prefix = itemStack.getType().isBlock() ? "block" : "item";
final String name = prefix + ".minecraft." + itemStack.getType().name().toLowerCase();
component.append(new TranslatableComponent(name));
}