also use that tool code in the CraftingStep, fixes #619

This commit is contained in:
way2muchnoise
2016-11-14 21:45:39 +01:00
parent 33e01ceb67
commit f33bf78226
2 changed files with 7 additions and 0 deletions

View File

@@ -105,6 +105,12 @@ public class CraftingStepCraft extends CraftingStep {
for (int i = 0; i < toInsert.size(); i++) { for (int i = 0; i < toInsert.size(); i++) {
ItemStack input = toInsert.get(i); ItemStack input = toInsert.get(i);
if (input != null) { if (input != null) {
// This will be a tool, like a hammer
if (input.isItemStackDamageable()) {
compare &= ~IComparer.COMPARE_DAMAGE;
} else {
compare |= IComparer.COMPARE_DAMAGE;
}
ItemStack actualInput = actualInputs.get(input, compare); ItemStack actualInput = actualInputs.get(input, compare);
ItemStack taken = ItemHandlerHelper.copyStackWithSize(actualInput, input.stackSize); ItemStack taken = ItemHandlerHelper.copyStackWithSize(actualInput, input.stackSize);
took[i] = taken; took[i] = taken;

View File

@@ -219,6 +219,7 @@ public class CraftingTask implements ICraftingTask {
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);
if (input != null) { if (input != null) {
// This will be a tool, like a hammer
if (input.isItemStackDamageable()) { if (input.isItemStackDamageable()) {
compare &= ~IComparer.COMPARE_DAMAGE; compare &= ~IComparer.COMPARE_DAMAGE;
} else { } else {