The Assembly Halo will not attempt to consume items case the Container Item is the same as the stack passed in. Closes #488

This commit is contained in:
Lizbeth Rika committed 2015-01-23 17:17:47 +00:00
1 parent 185ca19c9b
commit 6ef5c718f7
1 file changed
+12 -3
@@ -174,16 +174,25 @@ public class ItemCraftingHalo extends ItemMod {
for(int i = 0; i < inv.getSizeInventory(); i++) {
ItemStack stackAt = inv.getStackInSlot(i);
if(stackAt != null && stack.isItemEqual(stackAt) && ItemStack.areItemStackTagsEqual(stack, stackAt)) {
stackAt.stackSize--;
if(stackAt.stackSize == 0)
inv.setInventorySlotContents(i, null);
boolean consume = true;
ItemStack container = stackAt.getItem().getContainerItem(stackAt);
if(container != null) {
if(container == stackAt)
consume = false;
else {
InventoryHelper.insertItemIntoInventory(inv, container);
if(container.stackSize != 0 && player != null)
player.dropPlayerItemWithRandomChoice(container, false);
}
}
if(consume) {
stackAt.stackSize--;
if(stackAt.stackSize == 0)
inv.setInventorySlotContents(i, null);
}
return true;
}
}