badasintended / wthit

what the hell is that?
https://docs.bai.lol/wthit
Other
121 stars 21 forks source link

feat: add ability to show container contents with item names #267

Closed vlad-iakovlev closed 3 months ago

vlad-iakovlev commented 3 months ago

Proposed changes

Tested on Fabric 0.15.11, Minecraft 1.20.1

Description

This change adds two new components to the API and an option to enable them for the ItemProvider in wailax plugin.

The NamedItemComponent is used to display a single item, similar to the ItemComponent. I found it useful for Create's Placard (alternative to ItemFrame) and for Copycat material: 2024-06-01_21 42 56

The NamedItemListComponent is used to display a list of items, like the contents of a chest or a drawer. I like to use it with Modern Industrialization, where you have a lot of items with similar icons, so it's much easier to distinguish them by their names.

Some screenshots: 2024-06-01_21 16 08 2024-06-01_21 16 53

If the number of item types is greater than the maxHeight value, "..." is will be displayed to indicate that there are more items in the container. Players may want to adjust this setting, as the default value of 3 will only show 3 items. With maxHeight=10 it looks like this: 2024-06-01_21 16 34

vlad-iakovlev commented 3 months ago

Thanks for the comments, fixed and tested. Please let me know if there's anything else I can improve.

deirn commented 3 months ago

Thank you!