Skip to content

Commit

Permalink
Fixes a dupe with the crafting halos
Browse files Browse the repository at this point in the history
adds a check that will be redundant for 99% of items (#29)
  • Loading branch information
MeiTianyou authored May 17, 2023
1 parent 33a26a5 commit 1039b52
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/main/java/vazkii/botania/common/item/ItemCraftingHalo.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,17 @@ private static boolean consumeFromInventory(ItemStack stack, IInventory inv, Ent
ItemStack stackAt = inv.getStackInSlot(i);
if(stackAt != null && stack.isItemEqual(stackAt) && ItemStack.areItemStackTagsEqual(stack, stackAt)) {
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(stackAt.getItem().hasContainerItem()) {
//there are monsters in this world that will return false above but not null below
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);
}
}
}

Expand Down

0 comments on commit 1039b52

Please sign in to comment.