mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-13 16:54:06 +00:00
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:
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user