Hwyla

Hwyla

86M Downloads

[1.13 Suggestion] Get the block names from getNameTextComponent

TheLimePixel opened this issue ยท 4 comments

commented

Currently in Minecraft 1.13.2 you seem to getting the name of the blocks a player's looking at through their translation key, however, this doesn't take into account the mods that override getNameTextComponent so that they have more customization over their final localized name. For example: https://github.com/EmosewaPixel/PixelLib/blob/fe4ea235601de9a336f769b41d8c85f94d9779cf/src/main/java/com/EmosewaPixel/pixellib/blocks/MaterialBlock.java#L41

commented

Names are obtained via the item's stack-sensitive getTranslationKey() method.

https://github.com/TehNut/HWYLA/blob/1.13.2/src/main/java/mcp/mobius/waila/addons/core/HUDHandlerBlocks.java#L30

commented

Well, that's the same problem as in mine and in some other mods getDisplayName is overriden rather than the translation key of the block item.

commented

I don't see why your usecase would not fit into the stack aware getTranslationKey() method.

commented

Because it returns the translation key of the item, but the actual translation key hasn't been changed, getDisplayName has. As such my blocks get displayed with an unlocalized name by HWYLA