Fabric Item Groups Clash
Vaerian opened this issue ยท 2 comments
Cinderscapes (1.16.3) and Astromine (1.16.3) are encountering a compatibility issue that I believe might actually be an issue with fabric api. When Astromine is installed it causes the Cinderscapes item group to take over the vanilla item groups (TerraformersMC/Cinderscapes#91). From my testing this only occurs when Astromine is installed, I haven't encountered any other mods that do this (including large mods that add item groups like Terrestria and Tech Reborn). Both Astromine and Cinderscapes, however, use fabric api (seemingly as intended) in order to add item groups which makes me believe this is maybe an edge case in how fabric api implements item groups and needs to be fixed. The following are code snippets as to how both mods use fabric api to create item groups.
Astromine
public static ItemGroup register(String id, Supplier<ItemConvertible> icon) {
return FabricItemGroupBuilder.build(AstromineCommon.identifier(id), () -> new ItemStack(icon.get()));
}
Cinderscapes
public static void init() {
FabricItemGroupBuilder.create(Cinderscapes.id("items"))
.icon(() -> CinderscapesBlocks.UMBRAL_FUNGUS.asItem().getDefaultStack())
.appendItems((stacks) -> {
Registry.ITEM.stream().filter((item) -> {
return Registry.ITEM.getId(item).getNamespace().equals(Cinderscapes.NAMESPACE);
}).forEach((item) -> stacks.add(new ItemStack(item)));
})
.build();
}
Which both seem to be valid uses of the api. I think a good fix that I'm going to try will be to add a registry iterator and callback outside of the item group creator and add items that way, but either way this seems like the api is somehow broken.
Update, it's not just one thing making me think it really is fabric api. Curios API (Yes only the library for Curios) also triggers it making me think again that it's probably a fabric api issue.