Search in sources :

Example 21 with ColourMultiplier

use of codechicken.lib.render.pipeline.ColourMultiplier in project GregTech by GregTechCE.

the class MetaTileEntityPump method renderMetaTileEntity.

@Override
@SideOnly(Side.CLIENT)
public void renderMetaTileEntity(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline) {
    super.renderMetaTileEntity(renderState, translation, pipeline);
    ColourMultiplier multiplier = new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering()));
    IVertexOperation[] coloredPipeline = ArrayUtils.add(pipeline, multiplier);
    for (EnumFacing renderSide : EnumFacing.HORIZONTALS) {
        if (renderSide == getFrontFacing()) {
            Textures.PIPE_OUT_OVERLAY.renderSided(renderSide, renderState, translation, pipeline);
        } else {
            Textures.ADV_PUMP_OVERLAY.renderSided(renderSide, renderState, translation, coloredPipeline);
        }
    }
    Textures.SCREEN.renderSided(EnumFacing.UP, renderState, translation, pipeline);
    Textures.PIPE_IN_OVERLAY.renderSided(EnumFacing.DOWN, renderState, translation, pipeline);
}
Also used : IVertexOperation(codechicken.lib.render.pipeline.IVertexOperation) EnumFacing(net.minecraft.util.EnumFacing) ColourMultiplier(codechicken.lib.render.pipeline.ColourMultiplier) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

ColourMultiplier (codechicken.lib.render.pipeline.ColourMultiplier)21 IVertexOperation (codechicken.lib.render.pipeline.IVertexOperation)16 EnumFacing (net.minecraft.util.EnumFacing)7 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)7 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)5 Cuboid6 (codechicken.lib.vec.Cuboid6)3 IconTransformation (codechicken.lib.vec.uv.IconTransformation)3 CCModel (codechicken.lib.render.CCModel)2 CCRenderState (codechicken.lib.render.CCRenderState)2 Matrix4 (codechicken.lib.vec.Matrix4)2 Vector3 (codechicken.lib.vec.Vector3)2 IndexedCuboid6 (codechicken.lib.raytracer.IndexedCuboid6)1 BlockFace (codechicken.lib.render.BlockRenderer.BlockFace)1 TransformationList (codechicken.lib.vec.TransformationList)1 Translation (codechicken.lib.vec.Translation)1 Material (gregtech.api.unification.material.type.Material)1 BlockSurfaceRock (gregtech.common.blocks.surfacerock.BlockSurfaceRock)1 IBlockState (net.minecraft.block.state.IBlockState)1 Minecraft (net.minecraft.client.Minecraft)1 BlockRenderLayer (net.minecraft.util.BlockRenderLayer)1