use of buildcraft.core.builders.BuildingSlotBlock in project BuildCraft by BuildCraft.
the class BptBuilderBlueprint method deploy.
public void deploy() {
initialize();
for (List<BuildingSlotBlock> lb : buildList.values()) {
for (BuildingSlotBlock b : lb) {
if (b.mode == Mode.ClearIfInvalid) {
context.world.setBlockToAir(b.pos);
} else if (!b.schematic.doNotBuild()) {
b.stackConsumed = new LinkedList<>();
try {
for (ItemStack stk : b.getRequirements(context)) {
if (stk != null) {
b.stackConsumed.add(stk.copy());
}
}
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BCLog.logger.throwing(t);
}
b.writeToWorld(context);
}
}
}
for (BuildingSlotEntity e : entityList) {
e.stackConsumed = new LinkedList<>();
try {
for (ItemStack stk : e.getRequirements(context)) {
if (stk != null) {
e.stackConsumed.add(stk.copy());
}
}
} catch (Throwable t) {
// Defensive code against errors in implementers
t.printStackTrace();
BCLog.logger.throwing(t);
}
e.writeToWorld(context);
}
for (List<BuildingSlotBlock> lb : buildList.values()) {
for (BuildingSlotBlock b : lb) {
if (b.mode != Mode.ClearIfInvalid) {
b.postProcessing(context);
}
}
}
for (BuildingSlotEntity e : entityList) {
e.postProcessing(context);
}
}
Aggregations