use of buildcraft.core.blueprints.BptBuilderTemplate in project BuildCraft by BuildCraft.
the class TileBuilder method instanciateBluePrintBuilder.
@Deprecated
public BptBuilderBase instanciateBluePrintBuilder(BlockPos pos, EnumFacing o) {
BlueprintBase bpt = instanciateBlueprint();
if (bpt == null) {
return null;
}
bpt = bpt.adjustToWorld(worldObj, pos, o);
if (bpt != null) {
if (getStackInSlot(0).getItem() instanceof ItemBlueprintStandard) {
return new BptBuilderBlueprint((Blueprint) bpt, worldObj, pos);
} else if (getStackInSlot(0).getItem() instanceof ItemBlueprintTemplate) {
return new BptBuilderTemplate(bpt, worldObj, pos);
}
}
return null;
}
use of buildcraft.core.blueprints.BptBuilderTemplate in project BuildCraft by BuildCraft.
the class RecursiveBlueprintBuilder method nextBuilder.
public BptBuilderBase nextBuilder() {
if (!returnedThis) {
blueprint = blueprint.adjustToWorld(world, pos, dir);
returnedThis = true;
BptBuilderBase builder;
if (blueprint instanceof Blueprint) {
builder = new BptBuilderBlueprint((Blueprint) blueprint, world, pos);
} else if (blueprint instanceof Template) {
builder = new BptBuilderTemplate(blueprint, world, pos);
} else {
return null;
}
box.initialize(builder);
return builder;
}
// Free memory associated with this blueprint
blueprint = null;
if (current != null) {
BptBuilderBase builder = current.nextBuilder();
if (builder != null) {
return builder;
}
}
if (nextSubBlueprint >= subBlueprints.size()) {
return null;
}
NBTTagCompound nbt = subBlueprints.get(nextSubBlueprint);
BlueprintBase bpt = BlueprintBase.loadBluePrint(nbt.getCompoundTag("bpt"));
int nx = box.min().getX() + nbt.getInteger("x");
int ny = box.min().getY() + nbt.getInteger("y");
int nz = box.min().getZ() + nbt.getInteger("z");
EnumFacing nbtDir = EnumFacing.values()[nbt.getByte("dir")];
current = new RecursiveBlueprintBuilder(bpt, world, new BlockPos(nx, ny, nz), nbtDir);
nextSubBlueprint++;
return current.nextBuilder();
}
Aggregations