use of codechicken.lib.vec.Cuboid6 in project PneumaticCraft by MineMaarten.
the class PartPressureTube method getSubParts.
@Override
public Iterable<IndexedCuboid6> getSubParts() {
Iterable<Cuboid6> boxList = getCollisionBoxes();
LinkedList<IndexedCuboid6> partList = new LinkedList<IndexedCuboid6>();
for (Cuboid6 c : boxList) partList.add(new IndexedCuboid6(0, c));
return partList;
}
use of codechicken.lib.vec.Cuboid6 in project GregTech by GregTechCE.
the class MetaTileEntityRenderer method handleRenderBlockDamage.
@Override
public void handleRenderBlockDamage(IBlockAccess world, BlockPos pos, IBlockState state, TextureAtlasSprite sprite, BufferBuilder buffer) {
BlockMachine blockMachine = ((BlockMachine) state.getBlock());
Collection<AxisAlignedBB> boxes = blockMachine.getSelectedBoundingBoxes(world, pos, state);
List<Cuboid6> cuboid6List = boxes.stream().map(aabb -> new Cuboid6(aabb).subtract(pos)).collect(Collectors.toList());
CCRenderState renderState = CCRenderState.instance();
renderState.reset();
renderState.bind(buffer);
IVertexOperation[] pipeline = new IVertexOperation[2];
pipeline[0] = new Translation(pos);
pipeline[1] = new IconTransformation(sprite);
BlockFace blockFace = blockFaces.get();
for (Cuboid6 boundingBox : cuboid6List) {
for (EnumFacing face : EnumFacing.VALUES) {
blockFace.loadCuboidFace(boundingBox, face.getIndex());
renderState.setPipeline(blockFace, 0, blockFace.verts.length, pipeline);
renderState.render();
}
}
}
Aggregations