TehNut-Mods / HWYLA

A fork of Waila maintaining it for new MC versions
https://bitbucket.org/ProfMobius/waila
Other
120 stars 72 forks source link

[Forge] Item names are being used where block names would be expected #257

Open muzikbike opened 4 years ago

muzikbike commented 4 years ago

Currently, when aiming at a block which does not have a direct item equivalent, a closely related item will be shown instead. This works well for the image, since there isn't an associated item model present in the game to be rendered here, however the text string used is that of the related item, rather than the actual block, which is wrong - the name of the block should be used instead.

2020-06-15_22 27 33

The names of blocks are indeed present within the files, which can be tested by using the following command

/give @p minecraft:stick{CanDestroy:["minecraft:potted_cactus"]}

and reading the resulting item's summary, revealing that it can indeed break Potted Cactus, instead of just Cactus.

2020-06-15_22 27 46

The expected behaviour here would be that in the first picture, the cactus item model would be shown as it is currently, but the name shown next to it would be Potted Cactus, rather than just Cactus.

ChloeDawn commented 4 years ago

The edge cases of this misnaming in vanilla are few and far between. It'd be better to just special case objects such as flower pots. Hwyla already provides an API for mods to override the shown item.

ChloeDawn commented 4 years ago

Does this suit your needs?

java_23-06-2020_23-58-53

muzikbike commented 4 years ago

That should be sufficient, as the name is the only thing really at fault here.

Somewhat unrelated, but for blocks that don't have any associated items at all like end gateway blocks and (when made targetable in 1.16) fire, can they still be made to display the box, but without the icon, only the block's name and the mod it's from?

ChloeDawn commented 4 years ago

It is definitely possible from a technical standpoint but will require rewriting some of Hwyla's internals I think. I will look into it for a secondary pull request.

muzikbike commented 4 years ago

Just checked the latest fabric build for 1.16.1, and it looks like this bug is completely gone, and everything uses the block name instead of the item name in basically all cases (so redstone displays as Redstone Wire, placed tripwire as Tripwire, all crop types as their crop names instead of seeds, and so on). The only issue is that there seem to be some minor inconsistencies with wall variants, as wall coral fans still include the word Wall whereas wall variants of heads, signs and the like use their normal block names (is there a config somewhere for this where we can blacklist certain blocks from using their true name and force them to use the item name instead?)

So basically the only thing remaining is the other issue I mentioned above, which to the best of my knowledge affects the nether portal block, end portal block, end gateway block, fire, soul fire and frosted ice.

I don't know if the forge and fabric builds are fundamentally different from the bottom up though, so basically what I'm saying is the current 1.16.1 fabric build has the expected behaviour for such blocks, whereas forge 1.15 does not.

muzikbike commented 3 years ago

Just tested the latest fabric/forge builds on 1.16.5 and the results were mixed:

Forge: 2021-03-04_20 49 56 2021-03-04_20 49 59

Fabric: 2021-03-04_20 54 36 2021-03-04_20 54 38

Currently the Fabric behaviour is exactly as intended, however Forge still incorrectly uses the item name, so it's the one needing fixed here.