diff --git a/src/main/java/forestry/core/utils/StackUtils.java b/src/main/java/forestry/core/utils/StackUtils.java index c4f8ef25c..e24223d99 100755 --- a/src/main/java/forestry/core/utils/StackUtils.java +++ b/src/main/java/forestry/core/utils/StackUtils.java @@ -234,8 +234,7 @@ public class StackUtils { boolean matched = false; for (ItemStack cached : condensed) { - if (cached.isItemEqual(stack) - || (craftingEquivalency && isCraftingEquivalent(cached, stack, true, false))) { + if ((cached.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(cached, stack)) || (craftingEquivalency && isCraftingEquivalent(cached, stack, true, false))) { cached.stackSize += maxCountedPerStack > 0 && stack.stackSize > maxCountedPerStack ? maxCountedPerStack : stack.stackSize; matched = true; } @@ -285,12 +284,11 @@ public class StackUtils { for (ItemStack offer : condensedOffered) { if (isCraftingEquivalent(req, offer, oreDictionary, craftingTools)) { - matched = true; int stackCount = (int) Math.floor(offer.stackSize / req.stackSize); - if (stackCount <= 0) { - return 0; - } else if (count == 0) { + matched |= (stackCount > 0); + + if (count == 0) { count = stackCount; } else if (count > stackCount) { count = stackCount; @@ -343,6 +341,12 @@ public class StackUtils { return false; } + if (base.hasTagCompound() && !base.stackTagCompound.hasNoTags()) { + if (!ItemStack.areItemStacksEqual(base, comparison)) { + return false; + } + } + if (oreDictionary) { int[] idsBase = OreDictionary.getOreIDs(base); Arrays.sort(idsBase);