use of buildcraft.core.builders.BuilderItemMetaPair in project BuildCraft by BuildCraft.
the class BuildingSlotMapIterator method refresh.
public void refresh(TileAbstractBuilder builder) {
if (!isCreative) {
availablePairs.clear();
availablePairs.add(new BuilderItemMetaPair(null));
if (builder != null) {
for (int i = 0; i < builder.getSizeInventory(); i++) {
ItemStack stack = builder.getStackInSlot(i);
if (stack != null) {
availablePairs.add(new BuilderItemMetaPair(stack));
}
}
for (Tank t : builder.getFluidTanks()) {
if (t.getFluid() != null && t.getFluid().getFluid().getBlock() != null) {
availablePairs.add(new BuilderItemMetaPair(new ItemStack(t.getFluid().getFluid().getBlock())));
}
}
}
}
}
use of buildcraft.core.builders.BuilderItemMetaPair in project BuildCraft by BuildCraft.
the class BptBuilderBlueprint method addToBuildList.
private void addToBuildList(BuildingSlotBlock b) {
if (b != null) {
BuilderItemMetaPair imp = new BuilderItemMetaPair(context, b);
if (!buildList.containsKey(imp)) {
buildList.put(imp, new ArrayList<BuildingSlotBlock>());
}
buildList.get(imp).add(b);
if (buildStageOccurences == null) {
buildStageOccurences = new int[Math.max(3, b.buildStage + 1)];
} else if (buildStageOccurences.length <= b.buildStage) {
int[] newBSO = new int[b.buildStage + 1];
System.arraycopy(buildStageOccurences, 0, newBSO, 0, buildStageOccurences.length);
buildStageOccurences = newBSO;
}
buildStageOccurences[b.buildStage]++;
if (b.mode == Mode.Build) {
requirementMap.add(b, context);
b.internalRequirementRemovalListener = requirementMap;
}
}
}
Aggregations