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);
}
}
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);
}
}
}
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();
}
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();
}
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;
}
Aggregations