diff --git a/api/buildcraft/api/blueprints/Schematic.java b/api/buildcraft/api/blueprints/Schematic.java index 9b89114b..8a993868 100755 --- a/api/buildcraft/api/blueprints/Schematic.java +++ b/api/buildcraft/api/blueprints/Schematic.java @@ -80,25 +80,13 @@ public abstract class Schematic { ItemStack stack = slot.getStackInSlot(); ItemStack result = stack.copy(); - if (stack.isItemStackDamageable()) { - if (req.getItemDamage() + stack.getItemDamage() <= stack.getMaxDamage()) { - stack.setItemDamage(req.getItemDamage() + stack.getItemDamage()); - result.setItemDamage(req.getItemDamage()); - req.stackSize = 0; - } - - if (stack.getItemDamage() >= stack.getMaxDamage()) { - slot.decreaseStackInSlot(1); - } + if (stack.stackSize >= req.stackSize) { + result.stackSize = req.stackSize; + stack.stackSize -= req.stackSize; + req.stackSize = 0; } else { - if (stack.stackSize >= req.stackSize) { - result.stackSize = req.stackSize; - stack.stackSize -= req.stackSize; - req.stackSize = 0; - } else { - req.stackSize -= stack.stackSize; - stack.stackSize = 0; - } + req.stackSize -= stack.stackSize; + stack.stackSize = 0; } if (stack.stackSize == 0) { diff --git a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java index 87758b99..815cdac7 100644 --- a/common/buildcraft/core/blueprints/BptBuilderBlueprint.java +++ b/common/buildcraft/core/blueprints/BptBuilderBlueprint.java @@ -526,6 +526,8 @@ public class BptBuilderBlueprint extends BptBuilderBase { return !(builder.energyAvailable() < slot.getEnergyRequirement(stacksUsed)); } + IInventory invCopy = new InventoryCopy(builder); + for (ItemStack reqStk : tmpReq) { boolean itemBlock = reqStk.getItem() instanceof ItemBlock; Fluid fluid = itemBlock ? FluidRegistry.lookupFluidForBlock(((ItemBlock) reqStk.getItem()).field_150939_a) : null; @@ -534,7 +536,7 @@ public class BptBuilderBlueprint extends BptBuilderBase { continue; } - for (IInvSlot slotInv : InventoryIterator.getIterable(new InventoryCopy(builder), ForgeDirection.UNKNOWN)) { + for (IInvSlot slotInv : InventoryIterator.getIterable(invCopy, ForgeDirection.UNKNOWN)) { if (!builder.isBuildingMaterialSlot(slotInv.getIndex())) { continue; }