use of gregtech.common.blocks.surfacerock.BlockSurfaceRock in project GregTech by GregTechCE.
the class StoneRenderer method renderBlock.
@Override
public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) {
// otherwise, we are in solid rendering layer and render primary stone
CCRenderState renderState = CCRenderState.instance();
renderState.reset();
renderState.bind(buffer);
Matrix4 translation = new Matrix4();
translation.translate(pos.getX(), pos.getY(), pos.getZ());
TextureAtlasSprite stoneSprite = TextureUtils.getBlockTexture("stone");
Material material = ((BlockSurfaceRock) state.getBlock()).getStoneMaterial(world, pos, state);
int renderingColor = GTUtility.convertRGBtoOpaqueRGBA_CL(material.materialRGB);
IVertexOperation[] operations = new IVertexOperation[] { new IconTransformation(stoneSprite), new ColourMultiplier(renderingColor), new TransformationList(translation) };
if (world != null) {
renderState.setBrightness(world, pos);
}
renderState.setPipeline(operations);
CCModel actualModel = getActualModel(world, pos);
renderState.setModel(actualModel);
renderState.render();
return true;
}
Aggregations