This commit is contained in:
Adrian Siekierka 2017-01-03 22:03:16 +01:00
parent d2f9826d19
commit 790d05d4c4
2 changed files with 9 additions and 19 deletions

View file

@ -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) {

View file

@ -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;
}