Skip to content

Commit 6a7b18c

Browse files
committed
Compare prototype maps using value equality
1 parent 3fd3fce commit 6a7b18c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

neoforge/src/main/java/org/embeddedt/modernfix/neoforge/recipe/IngredientValueDeduplicator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ public int hashCode(Ingredient.ItemValue o) {
3535
}
3636

3737
private boolean areComponentsSame(ItemStack a, ItemStack b) {
38-
// Compare using stricter logic than vanilla: require the prototype maps to be identity-equal, and require
38+
// Compare using stricter logic than vanilla: require the prototype maps to be equal, and require
3939
// the values in the patch to also be identity-equal. This works around Neo allowing Holder.Reference objects
4040
// made with the server & client registries to be considered equal.
4141
if (a.getComponents() instanceof PatchedDataComponentMapAccessor aComps && b.getComponents() instanceof PatchedDataComponentMapAccessor bComps) {
42-
if (aComps.mfix$getPrototype() != bComps.mfix$getPrototype()) {
42+
if (!aComps.mfix$getPrototype().equals(bComps.mfix$getPrototype())) {
4343
return false;
4444
}
4545
var aPatch = aComps.mfix$getPatch();

0 commit comments

Comments
 (0)