Search in sources :

Example 1 with BuildingItem

use of buildcraft.core.builders.BuildingItem in project BuildCraft by BuildCraft.

the class RenderBuildingItems method render.

public void render(TileEntity tile, double x, double y, double z) {
    IBuildingItemsProvider provider = (IBuildingItemsProvider) tile;
    GL11.glPushMatrix();
    GL11.glTranslated(x, y, z);
    GL11.glTranslated(-tile.getPos().getX(), -tile.getPos().getY(), -tile.getPos().getZ());
    if (provider.getBuilders() != null) {
        synchronized (provider.getBuilders()) {
            for (BuildingItem i : provider.getBuilders()) {
                doRenderItem(i, 1.0F);
            }
        }
    }
    GL11.glPopMatrix();
}
Also used : BuildingItem(buildcraft.core.builders.BuildingItem) IBuildingItemsProvider(buildcraft.core.builders.IBuildingItemsProvider)

Example 2 with BuildingItem

use of buildcraft.core.builders.BuildingItem 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)

Aggregations

BuildingItem (buildcraft.core.builders.BuildingItem)2 LaserData (buildcraft.core.LaserData)1 Blueprint (buildcraft.core.blueprints.Blueprint)1 BlueprintBase (buildcraft.core.blueprints.BlueprintBase)1 BptBuilderBlueprint (buildcraft.core.blueprints.BptBuilderBlueprint)1 IBuildingItemsProvider (buildcraft.core.builders.IBuildingItemsProvider)1 Vec3d (net.minecraft.util.math.Vec3d)1