use of codechicken.lib.vec.uv.IconTransformation in project GregTech by GregTechCE.
the class MetaTileEntity method renderFace.
@SideOnly(Side.CLIENT)
public static void renderFace(CCRenderState renderState, EnumFacing face, Cuboid6 bounds, TextureAtlasSprite sprite, IVertexOperation... pipeline) {
BlockFace blockFace = blockFaces.get();
blockFace.loadCuboidFace(bounds, face.getIndex());
renderState.setPipeline(blockFace, 0, blockFace.verts.length, ArrayUtils.add(pipeline, new IconTransformation(sprite)));
renderState.render();
}
use of codechicken.lib.vec.uv.IconTransformation 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