use of gregtech.api.cover.ICoverable in project GregTech by GregTechCE.
the class InvPipeRenderer method renderBlock.
@Override
public boolean renderBlock(IBlockAccess world, BlockPos pos, IBlockState state, BufferBuilder buffer) {
CCRenderState renderState = CCRenderState.instance();
renderState.reset();
renderState.bind(buffer);
renderState.setBrightness(world, pos);
IVertexOperation[] pipeline = { new Translation(pos) };
BlockInventoryPipe block = (BlockInventoryPipe) state.getBlock();
TileEntityInventoryPipe tileEntity = (TileEntityInventoryPipe) block.getPipeTileEntity(world, pos);
if (tileEntity == null) {
return false;
}
int paintingColor = tileEntity.getInsulationColor();
int connectedSidesMask = block.getActualConnections(tileEntity, world);
BlockRenderLayer renderLayer = MinecraftForgeClient.getRenderLayer();
if (renderLayer == BlockRenderLayer.SOLID) {
renderPipe(renderState, pipeline, paintingColor, connectedSidesMask);
}
ICoverable coverable = tileEntity.getCoverableImplementation();
coverable.renderCovers(renderState, new Matrix4().translate(pos.getX(), pos.getY(), pos.getZ()), renderLayer);
return true;
}
Aggregations