Search in sources :

Example 11 with LaserData

use of buildcraft.core.LaserData in project BuildCraft by BuildCraft.

the class TileAbstractBuilder method writeData.

@Override
public void writeData(ByteBuf stream) {
    super.writeData(stream);
    stream.writeShort(pathLasers.size());
    for (LaserData ld : pathLasers) {
        ld.writeData(stream);
    }
}
Also used : LaserData(buildcraft.core.LaserData)

Example 12 with LaserData

use of buildcraft.core.LaserData in project BuildCraft by BuildCraft.

the class TileArchitect method readData.

@Override
public void readData(ByteBuf stream) {
    box.readData(stream);
    name = NetworkUtils.readUTF(stream);
    clientIsWorking = stream.readBoolean();
    mode = Mode.values()[stream.readByte()];
    if (mode == Mode.COPY) {
        readConfiguration.readData(stream);
        int size = stream.readUnsignedShort();
        subLasers.clear();
        for (int i = 0; i < size; i++) {
            LaserData ld = new LaserData();
            ld.readData(stream);
            subLasers.add(ld);
        }
    }
}
Also used : LaserData(buildcraft.core.LaserData)

Example 13 with LaserData

use of buildcraft.core.LaserData in project BuildCraft by BuildCraft.

the class TileBuilder method getRenderBoundingBox.

@Override
public AxisAlignedBB getRenderBoundingBox() {
    Box renderBox = new Box(this).extendToEncompass(box);
    for (LaserData l : pathLasers) {
        renderBox = renderBox.extendToEncompass(l.head);
        renderBox = renderBox.extendToEncompass(l.tail);
    }
    return renderBox.expand(50).getBoundingBox();
}
Also used : Box(buildcraft.lib.misc.data.Box) LaserData(buildcraft.core.LaserData)

Example 14 with LaserData

use of buildcraft.core.LaserData in project BuildCraft by BuildCraft.

the class RenderArchitect method renderTileEntityAt.

@Override
public void renderTileEntityAt(TileArchitect architect, double x, double y, double z, float f, int aThing) {
    Minecraft.getMinecraft().mcProfiler.startSection("bc");
    Minecraft.getMinecraft().mcProfiler.startSection("architect");
    super.renderTileEntityAt(architect, x, y, z, f, aThing);
    Minecraft.getMinecraft().mcProfiler.startSection("lasers");
    if (architect != null) {
        GL11.glPushMatrix();
        GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
        GL11.glEnable(GL11.GL_CULL_FACE);
        GL11.glEnable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        GL11.glTranslated(x, y, z);
        GL11.glTranslated(-architect.getPos().getX(), -architect.getPos().getY(), -architect.getPos().getZ());
        for (LaserData laser : architect.subLasers) {
            if (laser != null) {
                GL11.glPushMatrix();
                RenderLaser.doRenderLaserWave(TileEntityRendererDispatcher.instance.worldObj, Minecraft.getMinecraft().renderEngine, laser, EntityLaser.LASER_BLUE);
                GL11.glPopMatrix();
            }
        }
        GL11.glPopAttrib();
        GL11.glPopMatrix();
    }
    Minecraft.getMinecraft().mcProfiler.endSection();
    Minecraft.getMinecraft().mcProfiler.endSection();
    Minecraft.getMinecraft().mcProfiler.endSection();
}
Also used : LaserData(buildcraft.core.LaserData)

Example 15 with LaserData

use of buildcraft.core.LaserData in project BuildCraft by BuildCraft.

the class Utils method createLaserDataBox.

public static LaserData[] createLaserDataBox(Vec3d min, Vec3d max) {
    LaserData[] lasers = new LaserData[12];
    Vec3d[] p = new Vec3d[8];
    // ___
    p[0] = min;
    p[1] = new Vec3d(max.xCoord, min.yCoord, min.zCoord);
    p[2] = new Vec3d(min.xCoord, max.yCoord, min.zCoord);
    p[3] = new Vec3d(max.xCoord, max.yCoord, min.zCoord);
    p[4] = new Vec3d(min.xCoord, min.yCoord, max.zCoord);
    p[5] = new Vec3d(max.xCoord, min.yCoord, max.zCoord);
    p[6] = new Vec3d(min.xCoord, max.yCoord, max.zCoord);
    p[7] = max;
    lasers[0] = new LaserData(p[0], p[1]);
    lasers[1] = new LaserData(p[0], p[2]);
    lasers[2] = new LaserData(p[2], p[3]);
    lasers[3] = new LaserData(p[1], p[3]);
    lasers[4] = new LaserData(p[4], p[5]);
    lasers[5] = new LaserData(p[4], p[6]);
    lasers[6] = new LaserData(p[5], p[7]);
    lasers[7] = new LaserData(p[6], p[7]);
    lasers[8] = new LaserData(p[0], p[4]);
    lasers[9] = new LaserData(p[1], p[5]);
    lasers[10] = new LaserData(p[2], p[6]);
    lasers[11] = new LaserData(p[3], p[7]);
    return lasers;
}
Also used : LaserData(buildcraft.core.LaserData)

Aggregations

LaserData (buildcraft.core.LaserData)16 Vec3d (net.minecraft.util.math.Vec3d)3 Blueprint (buildcraft.core.blueprints.Blueprint)2 BptBuilderBlueprint (buildcraft.core.blueprints.BptBuilderBlueprint)2 BlueprintBase (buildcraft.core.blueprints.BlueprintBase)1 BuildingItem (buildcraft.core.builders.BuildingItem)1 Box (buildcraft.lib.misc.data.Box)1 BlockPos (net.minecraft.util.math.BlockPos)1