[Bug] NeoForge DataComponentIngredient is no longer compatible with REI in 1.21.4 #1798
Open
4 of 7 tasks
Labels
bug
Something isn't working
What happened?
I am developing a mod for Minecraft 1.21.4. I implemented some recipes which use the NeoForge built-in DataComponentIngredient. After two days of scratching my head about why this didn't work, I discovered an issue with REI in 1.21.4, which did not exist in earlier versions.
I have made a simple test case with vanilla items and data components. A simple datapack can be used to test it, no mod is required except REI. The test recipe converts a sharpness IV book into a dirt block.
I loaded this recipe into both of these environments:
The result is the following:
Screenshot of 1.21.1 vs 1.21.4:
As you can see in the screenshot, the recipe no longer works in 1.21.4. The DataComponentingredient (enchanted book) is not displayed and the + button does nothing. The recipe does work in the vanilla recipe book, both for 1.21.1 and 1.21.4.
What mod loaders are you seeing the problem on?
Forge
What do you think this bug is of?
Relevant log output
Anything else?
I have done some debugging myself and I have found that this is probably caused by
EntryIngredient.ofIngredient(Ingredient ingredient)
. Minecraft's Ingredient class no longer has a getItems function, so REI usesIngredient.values
. This is a Holder<Item>, which for custom NeoForge ingredients have no entries. A potential solution could be implementing explicit support for the NeoForge ICustomIngredient interface. But I do not know how that could be ported to other modloaders.By submitting this issue, I have included the necessary logs by pasting the contents into the correct location or attaching the file as an upload.
By submitting this issue, I have confirmed my REI and REI's dependencies are up to date.
The text was updated successfully, but these errors were encountered: