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)) {
|
for (ItemStack remaining : recipe.getRemainingItems(inv)) {
|
||||||
if (remaining != null) {
|
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<ItemStack> usedStacks = new LinkedList<>();
|
||||||
List<ICraftingStep> previousSteps = 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()) {
|
for (List<ItemStack> inputs : pattern.getOreInputs()) {
|
||||||
if (inputs == null || inputs.isEmpty()) {
|
if (inputs == null || inputs.isEmpty()) {
|
||||||
usedStacks.add(null);
|
usedStacks.add(null);
|
||||||
@@ -161,7 +164,7 @@ public class CraftingTask implements ICraftingTask {
|
|||||||
ItemStack inputStack = ItemHandlerHelper.copyStackWithSize(extraStack, takeQuantity);
|
ItemStack inputStack = ItemHandlerHelper.copyStackWithSize(extraStack, takeQuantity);
|
||||||
actualInputs.add(inputStack.copy());
|
actualInputs.add(inputStack.copy());
|
||||||
input.shrink(takeQuantity);
|
input.shrink(takeQuantity);
|
||||||
if (!inputStack.isItemStackDamageable() || !inputStack.isItemDamaged()) {
|
if (byproductList.get(inputStack, compare) == null) {
|
||||||
toCraft.add(inputStack);
|
toCraft.add(inputStack);
|
||||||
}
|
}
|
||||||
toInsert.remove(inputStack);
|
toInsert.remove(inputStack);
|
||||||
|
|||||||
@@ -183,6 +183,10 @@ public class Comparer implements IComparer {
|
|||||||
case "refinedstorage":
|
case "refinedstorage":
|
||||||
stack.getTagCompound().removeTag(BlockNode.NBT_REFINED_STORAGE_DATA);
|
stack.getTagCompound().removeTag(BlockNode.NBT_REFINED_STORAGE_DATA);
|
||||||
break;
|
break;
|
||||||
|
case "immersiveengineering":
|
||||||
|
stack.getTagCompound().removeTag("hammerDmg");
|
||||||
|
stack.getTagCompound().removeTag("cutterDmg");
|
||||||
|
break;
|
||||||
case "storagedrawers":
|
case "storagedrawers":
|
||||||
stack.getTagCompound().removeTag("material");
|
stack.getTagCompound().removeTag("material");
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user