Fabric API

Fabric API

111M Downloads

CustomIngredient broken equality

MehVahdJukaar opened this issue ยท 4 comments

commented

CustomIngredient instances (the vanilla Ingredient wrapped ones) dont have a custom equality implementation. This can cause all sorts of issues as a custom igredient will be considered equal to an empty one

commented

image

What codecs do or dont do has nothing to do with this

commented

Whats the use case for checking their equality? I assume this isnt a new issue to 1.21.4?

commented

use case can be anything. like putting ingredients in any data structure will break when mods throw it custom ones. Neoforge which has an awfully similar custom ingredient implementatio does have an equality check for it. This was tested in 1.21.1

commented

Aren't custom ingredients part of the ingredient codec? Optional field codecs with default values use equality checks to determine whether the value is serialized.