Fixed items that only differ in their NBT tag potentially being merged when picked up by a robot. Closes #449.

This commit is contained in:
Florian Nücke 2014-07-30 17:09:28 +02:00
parent 395533ef14
commit 28fc8b175b

View File

@ -88,7 +88,7 @@ class Inventory(val robot: tileentity.Robot) extends InventoryPlayer(null) {
else inventorySlots.find(slot => {
val existing = getStackInSlot(slot)
existing != null && existing.isItemEqual(stack) &&
(!existing.getHasSubtypes || existing.getItemDamage == stack.getItemDamage) &&
(!existing.getHasSubtypes || (existing.getItemDamage == stack.getItemDamage && ItemStack.areItemStackTagsEqual(existing, stack))) &&
(existing.stackSize < math.min(existing.getMaxStackSize, getInventoryStackLimit))
}).getOrElse(getFirstEmptyStackAccepting(stack))
if (slot >= firstInventorySlot) {