Make it obey material costs
That was easier than expected!
This commit is contained in:
parent
0c9a923fc5
commit
8f8e8f9b9b
2 changed files with 5 additions and 2 deletions
|
@ -153,7 +153,7 @@ public class BlockHandler {
|
|||
return cost;
|
||||
}
|
||||
|
||||
private boolean areItemsEqual(ItemStack stack1, ItemStack stack2) {
|
||||
protected final boolean areItemsEqual(ItemStack stack1, ItemStack stack2) {
|
||||
if (stack1 == null || stack2 == null)
|
||||
return false;
|
||||
if (!stack1.isItemEqual(stack2))
|
||||
|
|
|
@ -20,12 +20,14 @@ import buildcraft.core.EntityRobot;
|
|||
import buildcraft.core.IBuilderInventory;
|
||||
import buildcraft.core.IMachine;
|
||||
import buildcraft.core.TileBuildCraft;
|
||||
import buildcraft.core.inventory.InventoryMapper;
|
||||
import buildcraft.core.inventory.SimpleInventory;
|
||||
import buildcraft.core.network.PacketUpdate;
|
||||
import buildcraft.core.network.TileNetworkData;
|
||||
import java.io.IOException;
|
||||
import java.util.ListIterator;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
@ -42,6 +44,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
|||
private ListIterator<BlueprintBuilder.SchematicBuilder> blueprintIterator;
|
||||
private boolean builderDone = false;
|
||||
private SimpleInventory inv = new SimpleInventory(28, "Builder", 64);
|
||||
private IInventory invStock = new InventoryMapper(inv, 1, 27);
|
||||
private Blueprint blueprint;
|
||||
|
||||
public TileBuilder() {
|
||||
|
@ -105,7 +108,7 @@ public class TileBuilder extends TileBuildCraft implements IBuilderInventory, IP
|
|||
case EAST:
|
||||
blueprintOrientation = blueprintOrientation.getRotation(DOWN);
|
||||
}
|
||||
blueprintBuilder = new BlueprintBuilder(blueprint, worldObj, xCoord, yCoord, zCoord, blueprintOrientation, null);
|
||||
blueprintBuilder = new BlueprintBuilder(blueprint, worldObj, xCoord, yCoord, zCoord, blueprintOrientation, invStock);
|
||||
blueprintIterator = blueprintBuilder.getBuilders().listIterator();
|
||||
box.initialize(blueprintBuilder);
|
||||
box.reorder();
|
||||
|
|
Loading…
Reference in a new issue