more fixes to autocrafting and ore dict magic

This commit is contained in:
way2muchnoise
2016-11-03 22:21:39 +01:00
parent 2f860db667
commit abef0f10ad
2 changed files with 13 additions and 7 deletions

View File

@@ -80,6 +80,9 @@ public class CraftingPattern implements ICraftingPattern {
if (mekanism && ((ItemStack) input).hasTagCompound()) { if (mekanism && ((ItemStack) input).hasTagCompound()) {
stripped.getTagCompound().removeTag("mekData"); stripped.getTagCompound().removeTag("mekData");
} }
if (stripped.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
stripped.setItemDamage(0);
}
oreInputs.add(Collections.singletonList(stripped)); oreInputs.add(Collections.singletonList(stripped));
} else { } else {
List<ItemStack> cleaned = new LinkedList<>(); List<ItemStack> cleaned = new LinkedList<>();
@@ -88,6 +91,9 @@ public class CraftingPattern implements ICraftingPattern {
if (mekanism && stripped.hasTagCompound()){ if (mekanism && stripped.hasTagCompound()){
stripped.getTagCompound().removeTag("mekData"); stripped.getTagCompound().removeTag("mekData");
} }
if (stripped.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
stripped.setItemDamage(0);
}
cleaned.add(stripped); cleaned.add(stripped);
} }
oreInputs.add(cleaned); oreInputs.add(cleaned);

View File

@@ -189,8 +189,8 @@ public class CraftingTask implements ICraftingTask {
steps.add(new CraftingStepCraft(network, pattern, usedStacks)); steps.add(new CraftingStepCraft(network, pattern, usedStacks));
} }
ItemStack[] took = new ItemStack[9];
if (missing.isEmpty()) { if (missing.isEmpty()) {
ItemStack[] took = new ItemStack[9];
if (!pattern.isProcessing()) { if (!pattern.isProcessing()) {
for (int i = 0; i < usedStacks.size(); i++) { for (int i = 0; i < usedStacks.size(); i++) {
ItemStack input = usedStacks.get(i); ItemStack input = usedStacks.get(i);
@@ -202,14 +202,14 @@ public class CraftingTask implements ICraftingTask {
} }
} }
} }
}
for (ItemStack byproduct : (!pattern.isProcessing() && pattern.isOredict() && missing.isEmpty() ? pattern.getByproducts(took) : pattern.getByproducts())) { for (ItemStack byproduct : (!pattern.isProcessing() && pattern.isOredict() && missing.isEmpty() ? pattern.getByproducts(took) : pattern.getByproducts())) {
toInsert.add(byproduct.copy()); toInsert.add(byproduct.copy());
} }
for (ItemStack output : (!pattern.isProcessing() && pattern.isOredict() && missing.isEmpty() ? pattern.getOutputs(took) : pattern.getOutputs())) { for (ItemStack output : (!pattern.isProcessing() && pattern.isOredict() && missing.isEmpty() ? pattern.getOutputs(took) : pattern.getOutputs())) {
toInsert.add(output.copy()); toInsert.add(output.copy());
}
} }
usedPatterns.remove(pattern); usedPatterns.remove(pattern);