Take capabilities into account when comparing ItemStack NBT's. Closes #2726

This commit is contained in:
LexManos committed 2016-05-23 15:30:20 -07:00
1 parent 95bacd7a52
commit 9df1e4b11e
2 files changed
+45 -4

No files matched your search

@@ -114,4 +114,11 @@ public final class CapabilityDispatcher implements INBTSerializable<NBTTagCompou
}
}
}
public boolean areCompatible(CapabilityDispatcher other) //Called from ItemStack to compare equality.
{ // Only compares serializeable caps.
if (other == null) return this.writers.length == 0; // Done this way so we can do some pre-checks before doing the costly NBT serialization and compare
if (this.writers.length == 0) return other.writers.length == 0;
return this.serializeNBT().equals(other.serializeNBT());
}
}