Search in sources :

Example 1 with BptBuilderBlueprint

use of buildcraft.core.blueprints.BptBuilderBlueprint 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)

Example 2 with BptBuilderBlueprint

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

the class TileBuilder method updateRequirements.

private void updateRequirements() {
    List<RequirementItemStack> reqCopy = null;
    if (currentBuilder instanceof BptBuilderBlueprint) {
        currentBuilder.initialize();
        reqCopy = ((BptBuilderBlueprint) currentBuilder).getNeededItems();
    }
    for (EntityPlayer p : guiWatchers) {
        BuildCraftCore.instance.sendToPlayer(p, getItemRequirementsPacket(reqCopy));
    }
}
Also used : RequirementItemStack(buildcraft.core.blueprints.RequirementItemStack) EntityPlayer(net.minecraft.entity.player.EntityPlayer) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint)

Example 3 with BptBuilderBlueprint

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

the class TileQuarry method initializeBlueprintBuilder.

private void initializeBlueprintBuilder() {
    PatternQuarryFrame pqf = PatternQuarryFrame.INSTANCE;
    Blueprint bpt = pqf.getBlueprint(box, worldObj);
    builder = new BptBuilderBlueprint(bpt, worldObj, box.min());
    builder.setOrder(new AxisOrder(EnumAxisOrder.XZY, true, true, false));
    speed = 0;
    stage = Stage.BUILDING;
    sendNetworkUpdate();
}
Also used : Blueprint(buildcraft.core.blueprints.Blueprint) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint) EnumAxisOrder(buildcraft.lib.misc.data.EnumAxisOrder) AxisOrder(buildcraft.lib.misc.data.AxisOrder) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint)

Example 4 with BptBuilderBlueprint

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

the class TileConstructionMarker method update.

@Override
public void update() {
    super.update();
    BuildingItem toRemove = null;
    for (BuildingItem i : buildersInAction) {
        i.update();
        if (i.isDone) {
            toRemove = i;
        }
    }
    if (toRemove != null) {
        buildersInAction.remove(toRemove);
    }
    if (worldObj.isRemote) {
        return;
    }
    if (itemBlueprint != null && ItemBlueprint.getId(itemBlueprint) != null && bluePrintBuilder == null) {
        BlueprintBase bpt = ItemBlueprint.loadBlueprint(itemBlueprint);
        if (bpt != null && bpt instanceof Blueprint) {
            bpt = bpt.adjustToWorld(worldObj, pos, direction);
            if (bpt != null) {
                bluePrintBuilder = new BptBuilderBlueprint((Blueprint) bpt, worldObj, pos);
                bptContext = bluePrintBuilder.getContext();
                box.initialize(bluePrintBuilder);
                sendNetworkUpdate();
            }
        } else {
            return;
        }
    }
    if (laser == null && direction != null) {
        Vec3d point5 = new Vec3d(0.5, 0.5, 0.5);
        laser = new LaserData();
        laser.head = Utils.convert(pos).add(point5);
        laser.tail = laser.head.add(Utils.convert(direction, 0.5));
        laser.isVisible = true;
        sendNetworkUpdate();
    }
    if (initNBT != null) {
        if (bluePrintBuilder != null) {
            bluePrintBuilder.loadBuildStateToNBT(initNBT.getCompoundTag("builderState"), this);
        }
        initNBT = null;
    }
}
Also used : BuildingItem(buildcraft.core.builders.BuildingItem) BlueprintBase(buildcraft.core.blueprints.BlueprintBase) Blueprint(buildcraft.core.blueprints.Blueprint) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint) LaserData(buildcraft.core.LaserData) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint) Vec3d(net.minecraft.util.math.Vec3d)

Example 5 with BptBuilderBlueprint

use of buildcraft.core.blueprints.BptBuilderBlueprint 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;
}
Also used : BlueprintBase(buildcraft.core.blueprints.BlueprintBase) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint) BptBuilderTemplate(buildcraft.core.blueprints.BptBuilderTemplate)

Aggregations

BptBuilderBlueprint (buildcraft.core.blueprints.BptBuilderBlueprint)6 Blueprint (buildcraft.core.blueprints.Blueprint)3 BlueprintBase (buildcraft.core.blueprints.BlueprintBase)3 BptBuilderTemplate (buildcraft.core.blueprints.BptBuilderTemplate)2 Vec3d (net.minecraft.util.math.Vec3d)2 LaserData (buildcraft.core.LaserData)1 BptBuilderBase (buildcraft.core.blueprints.BptBuilderBase)1 BptContext (buildcraft.core.blueprints.BptContext)1 LibraryId (buildcraft.core.blueprints.LibraryId)1 RequirementItemStack (buildcraft.core.blueprints.RequirementItemStack)1 Template (buildcraft.core.blueprints.Template)1 BuildingItem (buildcraft.core.builders.BuildingItem)1 AxisOrder (buildcraft.lib.misc.data.AxisOrder)1 EnumAxisOrder (buildcraft.lib.misc.data.EnumAxisOrder)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 EnumFacing (net.minecraft.util.EnumFacing)1 BlockPos (net.minecraft.util.math.BlockPos)1