mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-16 18:55:03 -04:00
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:
parent
395533ef14
commit
28fc8b175b
@ -88,7 +88,7 @@ class Inventory(val robot: tileentity.Robot) extends InventoryPlayer(null) {
|
|||||||
else inventorySlots.find(slot => {
|
else inventorySlots.find(slot => {
|
||||||
val existing = getStackInSlot(slot)
|
val existing = getStackInSlot(slot)
|
||||||
existing != null && existing.isItemEqual(stack) &&
|
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))
|
(existing.stackSize < math.min(existing.getMaxStackSize, getInventoryStackLimit))
|
||||||
}).getOrElse(getFirstEmptyStackAccepting(stack))
|
}).getOrElse(getFirstEmptyStackAccepting(stack))
|
||||||
if (slot >= firstInventorySlot) {
|
if (slot >= firstInventorySlot) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user