mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Fix translations for blocks
This commit is contained in:
1 parent
5ba9f6d08e
commit
6235f30947
1 file changed
+4
-3
@@ -87,9 +87,10 @@ public final class CarbonUtils {
|
|||||||
if (itemStack.getItemMeta().hasDisplayName()) {
|
if (itemStack.getItemMeta().hasDisplayName()) {
|
||||||
component.append(TextComponent.fromLegacyText(itemStack.getItemMeta().getDisplayName()));
|
component.append(TextComponent.fromLegacyText(itemStack.getItemMeta().getDisplayName()));
|
||||||
} else {
|
} else {
|
||||||
final String name = itemStack.getItemMeta().hasDisplayName()
|
// As of 1.13, Material is 1:1 with MC's names
|
||||||
? itemStack.getItemMeta().getDisplayName()
|
final String prefix = itemStack.getType().isBlock() ? "block" : "item";
|
||||||
: "item.minecraft." + itemStack.getType().name().toLowerCase(); // As of 1.13, Material is 1:1 with MC's names
|
final String name = prefix + ".minecraft." + itemStack.getType().name().toLowerCase();
|
||||||
|
|
||||||
component.append(new TranslatableComponent(name));
|
component.append(new TranslatableComponent(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user