Search in sources :

Example 1 with BptContext

use of buildcraft.core.blueprints.BptContext in project BuildCraft by BuildCraft.

the class RealBlueprintDeployer method deployBlueprint.

public void deployBlueprint(World world, BlockPos pos, EnumFacing dir, Blueprint bpt) {
    bpt.id = new LibraryId();
    bpt.id.extension = "bpt";
    BptContext context = bpt.getContext(world, bpt.getBoxForPos(pos));
    if (bpt.rotate) {
        if (dir == EnumFacing.EAST) {
        // Do nothing
        } else if (dir == EnumFacing.SOUTH) {
            bpt.rotateLeft(context);
        } else if (dir == EnumFacing.WEST) {
            bpt.rotateLeft(context);
            bpt.rotateLeft(context);
        } else if (dir == EnumFacing.NORTH) {
            bpt.rotateLeft(context);
            bpt.rotateLeft(context);
            bpt.rotateLeft(context);
        }
    }
    Vec3d transform = Utils.convert(pos).subtract(Utils.convert(bpt.anchor));
    bpt.translateToWorld(transform);
    new BptBuilderBlueprint(bpt, world, pos).deploy();
}
Also used : LibraryId(buildcraft.core.blueprints.LibraryId) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint) BptContext(buildcraft.core.blueprints.BptContext) Vec3d(net.minecraft.util.math.Vec3d)

Aggregations

BptBuilderBlueprint (buildcraft.core.blueprints.BptBuilderBlueprint)1 BptContext (buildcraft.core.blueprints.BptContext)1 LibraryId (buildcraft.core.blueprints.LibraryId)1 Vec3d (net.minecraft.util.math.Vec3d)1