forward port fixes to autocrafting
This commit is contained in:
@@ -225,7 +225,7 @@ public class CraftingPattern implements ICraftingPattern {
|
||||
|
||||
for (ItemStack remaining : recipe.getRemainingItems(inv)) {
|
||||
if (remaining != null) {
|
||||
byproducts.add(Comparer.stripTags(remaining.copy()));
|
||||
byproducts.add(remaining.copy());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,9 @@ public class CraftingTask implements ICraftingTask {
|
||||
List<ItemStack> usedStacks = new LinkedList<>();
|
||||
List<ICraftingStep> previousSteps = new LinkedList<>();
|
||||
|
||||
IStackList<ItemStack> byproductList = API.instance().createItemStackList();
|
||||
pattern.getByproducts().stream().filter(Objects::nonNull).forEach(byproductList::add);
|
||||
|
||||
for (List<ItemStack> inputs : pattern.getOreInputs()) {
|
||||
if (inputs == null || inputs.isEmpty()) {
|
||||
usedStacks.add(null);
|
||||
@@ -161,7 +164,7 @@ public class CraftingTask implements ICraftingTask {
|
||||
ItemStack inputStack = ItemHandlerHelper.copyStackWithSize(extraStack, takeQuantity);
|
||||
actualInputs.add(inputStack.copy());
|
||||
input.shrink(takeQuantity);
|
||||
if (!inputStack.isItemStackDamageable() || !inputStack.isItemDamaged()) {
|
||||
if (byproductList.get(inputStack, compare) == null) {
|
||||
toCraft.add(inputStack);
|
||||
}
|
||||
toInsert.remove(inputStack);
|
||||
|
||||
@@ -183,6 +183,10 @@ public class Comparer implements IComparer {
|
||||
case "refinedstorage":
|
||||
stack.getTagCompound().removeTag(BlockNode.NBT_REFINED_STORAGE_DATA);
|
||||
break;
|
||||
case "immersiveengineering":
|
||||
stack.getTagCompound().removeTag("hammerDmg");
|
||||
stack.getTagCompound().removeTag("cutterDmg");
|
||||
break;
|
||||
case "storagedrawers":
|
||||
stack.getTagCompound().removeTag("material");
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user