Search in sources :

Example 1 with LaserData

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

the class TileConstructionMarker method readData.

@Override
public void readData(ByteBuf stream) {
    box.readData(stream);
    int flags = stream.readUnsignedByte();
    if ((flags & 1) != 0) {
        laser = new LaserData();
        laser.readData(stream);
    } else {
        laser = null;
    }
    if ((flags & 2) != 0) {
        itemBlueprint = NetworkUtils.readStack(stream);
    } else {
        itemBlueprint = null;
    }
}
Also used : LaserData(buildcraft.core.LaserData) Blueprint(buildcraft.core.blueprints.Blueprint) BptBuilderBlueprint(buildcraft.core.blueprints.BptBuilderBlueprint)

Example 2 with LaserData

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

the class TileAbstractBuilder method readData.

@Override
public void readData(ByteBuf stream) {
    super.readData(stream);
    int size = stream.readUnsignedShort();
    pathLasers.clear();
    for (int i = 0; i < size; i++) {
        LaserData ld = new LaserData();
        ld.readData(stream);
        pathLasers.add(ld);
    }
}
Also used : LaserData(buildcraft.core.LaserData)

Example 3 with LaserData

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

the class RenderPathMarker method renderTileEntityAt.

@Override
public void renderTileEntityAt(TilePathMarker marker, double x, double y, double z, float f, int arg) {
    if (marker != null) {
        GL11.glPushMatrix();
        GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
        GL11.glTranslated(x, y, z);
        GL11.glTranslated(-marker.getPos().getX(), -marker.getPos().getY(), -marker.getPos().getZ());
        for (LaserData laser : marker.lasers) {
            if (laser != null) {
                GL11.glPushMatrix();
                RenderLaser.doRenderLaser(TileEntityRendererDispatcher.instance.worldObj, Minecraft.getMinecraft().renderEngine, laser, EntityLaser.LASER_BLUE);
                GL11.glPopMatrix();
            }
        }
        GL11.glPopAttrib();
        GL11.glPopMatrix();
    }
}
Also used : LaserData(buildcraft.core.LaserData)

Example 4 with LaserData

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

the class TileLaser method initialize.

@Override
public void initialize() {
    super.initialize();
    if (laser == null) {
        laser = new LaserData();
    }
    laser.isVisible = false;
    laser.head = Utils.convert(getPos());
    laser.tail = Utils.convert(getPos());
    laser.isGlowing = true;
}
Also used : LaserData(buildcraft.core.LaserData)

Example 5 with LaserData

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

the class TileArchitect method writeData.

@Override
public void writeData(ByteBuf stream) {
    box.writeData(stream);
    NetworkUtils.writeUTF(stream, name);
    stream.writeBoolean(getIsWorking());
    stream.writeByte(mode.ordinal());
    if (mode == Mode.COPY) {
        readConfiguration.writeData(stream);
        stream.writeShort(subLasers.size());
        for (LaserData ld : subLasers) {
            ld.writeData(stream);
        }
    }
}
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