mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Take capabilities into account when comparing ItemStack NBT's. Closes #2726
This commit is contained in:
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());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user