[fabric-item-groups] Feature request: add a way to not overwrite the vanilla behaviour of appendStacks
UpcraftLP opened this issue ยท 3 comments
currently, when using FabricItemGroupBuilder#stacksForDisplay()
the vanilla behaviour of adding all items that have this itemgroup is replaced with a completely custom list.
My suggestion is to add another overload with a boolean flag, that only replaces the items when set to true
(default value to not break backwards compatibility).
the current implementation would then just call the new one with the default value.
I would add onto this, and request a FabricItemGroupBuilder#build(BiFunction<Integer, String, ItemGroup>)
to be added, so that we can use custom item group implementations (for eg. specific item display customization). Currently, if we want to use something else than Fabric API's implementation, we have to either use the internal interface ItemGroupExtensions
, or copy the internals entirely.
While FabricItemGroupBuilder#stacksForDisplay()
is now deprecated, the method that replaced it is no better. I would also like to see the appendItems()
method actually append rathen then replace. I should add, though, that a current workaround would be to add something like Registry.ITEM.stream().filter(isInThisGroup()).map(ItemStack::new).forEach(itemList::add);
to the beginning of the Consumer
, thus placing any existing group members back into the list before replacing it.