Compare prototype maps using value equality

This commit is contained in:
embeddedt 2025-07-13 18:27:00 -04:00
parent 3fd3fce262
commit 6a7b18cc6b
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

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