Backport fixes for #4675 and #4665 to 1.15 (#4676)

* Serialize the complete NBT data to avoid mismatches (#4665)

This might increase the network traffic a bit, but the amount of mods actually using the share tag seems to be very limited.
For now it is worth the risk as it solves the problem. In case we run into actual issues, there might still be other solutions, which will be way more complex and can potentially introduce additional problems.

(cherry picked from commit e90dd2f9c6)
(cherry picked from commit ab393b0ed1)

* Fixes #4669: Take NBT into account for comparing. (#4675)

This only covers combining different items together.
Fuzzy filtering is still a bit too fuzzy for corner cases.

Co-authored-by: yueh <yueh@users.noreply.github.com>
This commit is contained in:
shartte
2020-09-01 22:48:07 +02:00
committed by GitHub
parent a212448a4e
commit 28c458fb61
2 changed files with 5 additions and 2 deletions
@@ -29,6 +29,7 @@ import net.minecraft.nbt.CompoundNBT;
import appeng.api.config.FuzzyMode;
final class AESharedItemStack implements Comparable<AESharedItemStack> {
private final ItemStack itemStack;
private final int itemId;
private final int itemDamage;
@@ -97,7 +98,8 @@ final class AESharedItemStack implements Comparable<AESharedItemStack> {
return damageValue;
}
return 0;
return System.identityHashCode(this.getDefinition().getTag())
- System.identityHashCode(b.getDefinition().getTag());
}
private int makeHashCode() {
@@ -183,4 +185,5 @@ final class AESharedItemStack implements Comparable<AESharedItemStack> {
}
}
}