Java 类net.minecraft.client.renderer.EntityRenderer 实例源码

项目:DankNull    文件:RenderModel.java   
public static void renderQuads(VertexBuffer renderer, List<BakedQuad> quads, int color, ItemStack stack) {
    boolean flag = (color == -1) && (!stack.isEmpty());
    int i = 0;
    for (int j = quads.size(); i < j; i++) {
        BakedQuad bakedquad = quads.get(i);
        int k = color;
        if ((flag) && (bakedquad.hasTintIndex())) {
            ItemColors itemColors = Minecraft.getMinecraft().getItemColors();
            k = itemColors.getColorFromItemstack(stack, bakedquad.getTintIndex());
            if (EntityRenderer.anaglyphEnable) {
                k = TextureUtil.anaglyphColor(k);
            }
            k |= 0xFF000000;
        }
        LightUtil.renderQuadColor(renderer, bakedquad, k);
    }
}
项目:DecompiledMinecraft    文件:RenderItem.java   
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && stack != null;
    int i = 0;

    for (int j = quads.size(); i < j; ++i)
    {
        BakedQuad bakedquad = (BakedQuad)quads.get(i);
        int k = color;

        if (flag && bakedquad.hasTintIndex())
        {
            k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable)
            {
                k = TextureUtil.anaglyphColor(k);
            }

            k = k | -16777216;
        }

        this.renderQuad(renderer, bakedquad, k);
    }
}
项目:Wurst-MC-1.12    文件:LsdMod.java   
@Override
public void onEnable()
{
    if(!OpenGlHelper.shadersSupported)
    {
        wurst.events.add(UpdateListener.class, this);
        return;
    }

    if(!(mc.getRenderViewEntity() instanceof EntityPlayer))
    {
        setEnabled(false);
        return;
    }

    if(mc.entityRenderer.theShaderGroup != null)
        mc.entityRenderer.theShaderGroup.deleteShaderGroup();
    mc.entityRenderer.shaderIndex = 19;
    mc.entityRenderer.loadShader(EntityRenderer.SHADERS_TEXTURES[19]);
}
项目:BaseClient    文件:ShadersRender.java   
public static void renderHand0(EntityRenderer er, float par1, int par2)
{
    if (!Shaders.isShadowPass)
    {
        Item item = Shaders.itemToRender != null ? Shaders.itemToRender.getItem() : null;
        Block block = item instanceof ItemBlock ? ((ItemBlock)item).getBlock() : null;

        if (!(item instanceof ItemBlock) || !(block instanceof Block) || block.getBlockLayer() == EnumWorldBlockLayer.SOLID)
        {
            Shaders.readCenterDepth();
            Shaders.beginHand();
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            er.renderHand(par1, par2);
            Shaders.endHand();
            Shaders.isHandRendered = true;
        }
    }
}
项目:BaseClient    文件:RenderItem.java   
private void renderQuads(WorldRenderer renderer, List<BakedQuad> quads, int color, ItemStack stack)
{
    boolean flag = color == -1 && stack != null;
    int i = 0;

    for (int j = quads.size(); i < j; ++i)
    {
        BakedQuad bakedquad = (BakedQuad)quads.get(i);
        int k = color;

        if (flag && bakedquad.hasTintIndex())
        {
            k = stack.getItem().getColorFromItemStack(stack, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable)
            {
                k = TextureUtil.anaglyphColor(k);
            }

            k = k | -16777216;
        }

        this.renderQuad(renderer, bakedquad, k);
    }
}
项目:Backmemed    文件:ShadersRender.java   
public static void renderHand0(EntityRenderer er, float par1, int par2)
{
    if (!Shaders.isShadowPass)
    {
        boolean flag = Shaders.isItemToRenderMainTranslucent();
        boolean flag1 = Shaders.isItemToRenderOffTranslucent();

        if (!flag || !flag1)
        {
            Shaders.readCenterDepth();
            Shaders.beginHand();
            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            Shaders.setSkipRenderHands(flag, flag1);
            er.renderHand(par1, par2, true, false, false);
            Shaders.endHand();
            Shaders.setHandsRendered(!flag, !flag1);
            Shaders.setSkipRenderHands(false, false);
        }
    }
}
项目:Backmemed    文件:Render.java   
/**
 * Renders an entity's name above its head
 */
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance)
{
    double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);

    if (d0 <= (double)(maxDistance * maxDistance))
    {
        boolean flag = entityIn.isSneaking();
        float f = this.renderManager.playerViewY;
        float f1 = this.renderManager.playerViewX;
        boolean flag1 = this.renderManager.options.thirdPersonView == 2;
        float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
        int i = "deadmau5".equals(str) ? -10 : 0;
        for(Friend friend: Wrapper.getFriends().friendsList) {
            str.replace(friend.getName(), friend.getAlias());
        }
        if(Wrapper.getFriends().isFriend(str)) {
            str = "\2479" + str;
        }
        if (entityIn instanceof EntityLivingBase) {
        str = str + " \247a" + ((double)Math.round((((EntityLivingBase) entityIn).getHealth() * 100) / 100) / 2);
        }
        if(!Hacks.findMod(Nametags.class).isEnabled())
            EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
    }
}
项目:CustomWorldGen    文件:Render.java   
/**
 * Renders an entity's name above its head
 */
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance)
{
    double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);

    if (d0 <= (double)(maxDistance * maxDistance))
    {
        boolean flag = entityIn.isSneaking();
        float f = this.renderManager.playerViewY;
        float f1 = this.renderManager.playerViewX;
        boolean flag1 = this.renderManager.options.thirdPersonView == 2;
        float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
        int i = "deadmau5".equals(str) ? -10 : 0;
        EntityRenderer.drawNameplate(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
    }
}
项目:ThaumOres    文件:TileInfusedBlockOreRenderer.java   
private int setBrightness(Tessellator tessellator, IBlockAccess blockAccess, int x, int y, int z, Block block) {
    int mb = block.getMixedBrightnessForBlock(blockAccess, x, y, z);
    tessellator.setBrightness(mb);

    float f = 1.0F;

    int l = block.colorMultiplier(blockAccess, x, y, z);
    float f1 = (l >> 16 & 0xFF) / 255.0F;
    float f2 = (l >> 8 & 0xFF) / 255.0F;
    float f3 = (l & 0xFF) / 255.0F;
    if (EntityRenderer.anaglyphEnable) {
        float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f7 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f6;
        f2 = f4;
        f3 = f7;
    }
    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
    return mb;
}
项目:ExtraUtilities    文件:FakeRenderEtherealBlocks.java   
public boolean renderStandardBlock(final Block p_147784_1_, final int p_147784_2_, final int p_147784_3_, final int p_147784_4_) {
    final int l = p_147784_1_.colorMultiplier(this.blockAccess, p_147784_2_, p_147784_3_, p_147784_4_);
    float f = (l >> 16 & 0xFF) / 255.0f;
    float f2 = (l >> 8 & 0xFF) / 255.0f;
    float f3 = (l & 0xFF) / 255.0f;
    if (EntityRenderer.anaglyphEnable) {
        final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
        final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
        final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
        f = f4;
        f2 = f5;
        f3 = f6;
    }
    f *= 0.75f;
    f2 *= 0.75f;
    f3 *= 0.75f;
    return this.renderStandardBlockWithColorMultiplier(p_147784_1_, p_147784_2_, p_147784_3_, p_147784_4_, f, f2, f3);
}
项目:ExtraUtilities    文件:RenderBlockColor.java   
public boolean renderWorldBlock(final IBlockAccess world, final int par2, final int par3, final int par4, final Block par1Block, final int modelId, final RenderBlocks renderer) {
    final Tessellator var8 = Tessellator.instance;
    final int i = world.getBlockMetadata(par2, par3, par4);
    float f = BlockColor.initColor[i][0];
    float f2 = BlockColor.initColor[i][1];
    float f3 = BlockColor.initColor[i][2];
    final TileEntity data = world.getTileEntity(BlockColorData.dataBlockX(par2), BlockColorData.dataBlockY(par3), BlockColorData.dataBlockZ(par4));
    if (data instanceof TileEntityBlockColorData) {
        f = ((TileEntityBlockColorData)data).palette[i][0];
        f2 = ((TileEntityBlockColorData)data).palette[i][1];
        f3 = ((TileEntityBlockColorData)data).palette[i][2];
    }
    if (EntityRenderer.anaglyphEnable) {
        final float f4 = (f * 30.0f + f2 * 59.0f + f3 * 11.0f) / 100.0f;
        final float f5 = (f * 30.0f + f2 * 70.0f) / 100.0f;
        final float f6 = (f * 30.0f + f3 * 70.0f) / 100.0f;
        f = f4;
        f2 = f5;
        f3 = f6;
    }
    return (Minecraft.isAmbientOcclusionEnabled() && par1Block.getLightValue() == 0) ? renderer.renderStandardBlockWithAmbientOcclusion(par1Block, par2, par3, par4, f, f2, f3) : renderer.renderStandardBlockWithColorMultiplier(par1Block, par2, par3, par4, f, f2, f3);
}
项目:4Space-5    文件:BlockRendererCavernousVines.java   
public void renderBlockMeteor(RenderBlocks renderBlocks, Block par1Block, IBlockAccess var1, int par2, int par3, int par4)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(par1Block.getMixedBrightnessForBlock(var1, par2, par3, par4));
    float f = 1.0F;
    int l = par1Block.colorMultiplier(var1, par2, par3, par4);
    float f1 = (l >> 16 & 255) / 255.0F;
    float f2 = (l >> 8 & 255) / 255.0F;
    float f3 = (l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f4;
        f2 = f5;
        f3 = f6;
    }

    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);

    renderBlocks.drawCrossedSquares(par1Block.getIcon(0, var1.getBlockMetadata(par2, par3, par4)), par2, par3, par4, 1.0F);
}
项目:metamorph    文件:RenderingHandler.java   
/**
 * Renders an entity's name above its head (copied and modified from 
 * {@link RenderLivingBase})
 */
protected void renderEntityName(EntityLivingBase entity, String name, double x, double y, double z)
{
    if (name.isEmpty())
    {
        return;
    }

    boolean sneaking = entity.isSneaking();
    boolean thirdFrontal = this.manager.options.thirdPersonView == 2;

    float px = this.manager.playerViewY;
    float py = this.manager.playerViewX;
    float pz = entity.height + 0.5F - (sneaking ? 0.25F : 0.0F);

    int i = "deadmau5".equals(name) ? -10 : 0;

    EntityRenderer.drawNameplate(this.manager.getFontRenderer(), name, (float) x, (float) y + pz, (float) z, i, px, py, thirdFrontal, sneaking);
}
项目:DynamicSurroundings    文件:StormSplashRenderer.java   
protected void playSplashSound(final EntityRenderer renderer, final World world, final Entity player, double x,
        double y, double z) {

    this.pos.setPos(x, y - 1, z);
    final boolean hasDust = biomeHasDust(world.getBiome(this.pos));
    final Block block = WorldUtils.getBlockState(world, this.pos).getBlock();
    final SoundEvent sound = getBlockSoundFX(block, hasDust, world);
    if (sound != null) {
        final float volume = calculateRainSoundVolume(world);
        float pitch = 1.0F;
        final int playerY = MathHelper.floor(player.posY);
        this.pos.setPos(player.posX, 0, player.posZ);
        if (y > player.posY + 1.0D && getPrecipitationHeight(world, 0, this.pos).getY() > playerY)
            pitch = 0.5F;
        pitch -= (this.RANDOM.nextFloat() - this.RANDOM.nextFloat()) * 0.1F;
        this.pos.setPos(x, y, z);
        SoundEngine.instance().playSound(this.pos, sound, SoundCategory.WEATHER, volume, pitch);
    }
}
项目:EvenWurse    文件:LsdMod.java   
@Override
public void onEnable() {
    if (OpenGlHelper.shadersSupported) {
        if (Minecraft.getMinecraft().func_175606_aa() instanceof EntityPlayer) {
            if (Minecraft.getMinecraft().entityRenderer.theShaderGroup != null) {
                Minecraft.getMinecraft().entityRenderer.theShaderGroup.deleteShaderGroup();
            }

            Minecraft.getMinecraft().entityRenderer.shaderIndex = 19;

            if (Minecraft.getMinecraft().entityRenderer.shaderIndex != EntityRenderer.shaderCount) {
                Minecraft.getMinecraft().entityRenderer.func_175069_a(EntityRenderer.shaderResourceLocations[19]);
            } else {
                Minecraft.getMinecraft().entityRenderer.theShaderGroup = null;
            }
        }
    }
    WurstClient.INSTANCE.events.add(UpdateListener.class, this);
}
项目:ShadyMod    文件:ShadyMod.java   
public void activateBatch()
{
    if(batch != null)
    {
        if(OpenGlHelper.shadersSupported)
        {
            try
            {
                ShaderGroup theShaderGroup = batch.toShaderGroup(resManager);
                theShaderGroup.createBindFramebuffers(Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight);
                ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, theShaderGroup, 51);
                ObfuscationReflectionHelper.setPrivateValue(EntityRenderer.class, Minecraft.getMinecraft().entityRenderer, true, 55);
            }
            catch(JsonException e)
            {
                e.printStackTrace();
            }
        }
    }
}
项目:TechStack-s-HeavyMachineryMod    文件:TileEntityCrateRenderer.java   
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
        bakedquad = (BakedQuad) iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.hasTintIndex()) {
            // j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable) {
                j = TextureUtil.anaglyphColor(j);
            }

            j |= -16777216;
        }
    }
}
项目:TechStack-s-HeavyMachineryMod    文件:RenderDumpTruck.java   
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
        bakedquad = (BakedQuad) iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.hasTintIndex()) {
            // j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable) {
                j = TextureUtil.anaglyphColor(j);
            }

            j |= -16777216;
        }
    }
}
项目:TechStack-s-HeavyMachineryMod    文件:RenderExcavator.java   
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
        bakedquad = (BakedQuad) iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.hasTintIndex()) {
            // j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable) {
                j = TextureUtil.anaglyphColor(j);
            }

            j |= -16777216;
        }
    }
}
项目:TechStack-s-HeavyMachineryMod    文件:RenderGrader.java   
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
        bakedquad = (BakedQuad) iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.hasTintIndex()) {
            // j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable) {
                j = TextureUtil.anaglyphColor(j);
            }

            j |= -16777216;
        }
    }
}
项目:TechStack-s-HeavyMachineryMod    文件:RenderContinuousMiner.java   
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
        bakedquad = (BakedQuad) iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.hasTintIndex()) {
            // j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable) {
                j = TextureUtil.anaglyphColor(j);
            }

            j |= -16777216;
        }
    }
}
项目:TechStack-s-HeavyMachineryMod    文件:RenderBagger.java   
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
        bakedquad = (BakedQuad) iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.hasTintIndex()) {
            // j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable) {
                j = TextureUtil.anaglyphColor(j);
            }

            j |= -16777216;
        }
    }
}
项目:TechStack-s-HeavyMachineryMod    文件:RenderLoader.java   
private void RenderHelper_a(BufferBuilder p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_) {
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j)) {
        bakedquad = (BakedQuad) iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.hasTintIndex()) {
            // j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.getTintIndex());

            if (EntityRenderer.anaglyphEnable) {
                j = TextureUtil.anaglyphColor(j);
            }

            j |= -16777216;
        }
    }
}
项目:ThaumicThings    文件:BlockRenderingHandler.java   
public int getBrightness(IBlockAccess blockAccess, int x, int y, int z, Block block)
{
    int mb = block.getMixedBrightnessForBlock(blockAccess, x, y, z);
    tessellator.setBrightness(mb);
    float f = 1.0F;
    int l = block.colorMultiplier(blockAccess, x, y, z);
    float f1 = (float) (l >> 16 & 255) / 255.0F;
    float f2 = (float) (l >> 8 & 255) / 255.0F;
    float f3 = (float) (l & 255) / 255.0F;
    if (EntityRenderer.anaglyphEnable)
    {
        float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f7 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f6;
        f2 = f4;
        f3 = f7;
    }

    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
    return mb;
}
项目:VoidGlasses    文件:ClientProxy.java   
public void activateShader(int shaderIndex) {
    if (OpenGlHelper.areShadersSupported() && shaderIndex < EntityRenderer.shaderResourceLocations.length) {
        if (Minecraft.getMinecraft().entityRenderer.theShaderGroup != null)
            Minecraft.getMinecraft().entityRenderer.theShaderGroup.deleteShaderGroup();
        Minecraft.getMinecraft().entityRenderer.theShaderGroup = null;
        ResourceLocation shader = shaderList.get(shaderIndex);
        if (shader != null) {
            Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new ChatComponentText(String.format(StatCollector.translateToLocal("voidglasses.shaderActivate"), shader.toString())));
            Minecraft.getMinecraft().entityRenderer.loadShader(shader);
            shaderActivated = true;
            setIndex = shaderIndex;
        } else {
            shaderActivated = false;
            setIndex = -1;
        }
    }
}
项目:Cooking-with-TFC    文件:CWTFCRenderer.java   
public void setItemShading()
{
    Tessellator tessellator = Tessellator.instance;
    int color = block.colorMultiplier(renderer.blockAccess, x, y, z);
       float red = (float)(color >> 16 & 255) / 255.0F;
       float green = (float)(color >> 8 & 255) / 255.0F;
       float blue = (float)(color & 255) / 255.0F;

       if (EntityRenderer.anaglyphEnable)
       {
           float redAna = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
           float greenAna = (red * 30.0F + green * 70.0F) / 100.0F;
           float blueAna = (red * 30.0F + blue * 70.0F) / 100.0F;
           red = redAna;
           green = greenAna;
           blue = blueAna;
       }

       tessellator.setColorOpaque_F(red, green, blue);
    tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
}
项目:Gadomancy    文件:BlockExtendedNodeJarRenderer.java   
private int setBrightness(IBlockAccess blockAccess, int i, int j, int k, Block block) {
    Tessellator tessellator = Tessellator.instance;
    int mb = block.getMixedBrightnessForBlock(blockAccess, i, j, k);
    tessellator.setBrightness(mb);

    float f = 1.0F;

    int l = block.colorMultiplier(blockAccess, i, j, k);
    float f1 = (l >> 16 & 0xFF) / 255.0F;
    float f2 = (l >> 8 & 0xFF) / 255.0F;
    float f3 = (l & 0xFF) / 255.0F;
    if (EntityRenderer.anaglyphEnable) {
        float f6 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F;
        float f4 = (f1 * 30.0F + f2 * 70.0F) / 100.0F;
        float f7 = (f1 * 30.0F + f3 * 70.0F) / 100.0F;
        f1 = f6;
        f2 = f4;
        f3 = f7;
    }
    tessellator.setColorOpaque_F(f * f1, f * f2, f * f3);
    return mb;
}
项目:MachineMod    文件:RenderDumpTruck.java   
private void RenderHelper_a(WorldRenderer p_175032_1_, List p_175032_2_, int p_175032_3_, ItemStack p_175032_4_)
{
    boolean flag = p_175032_3_ == -1 && p_175032_4_ != null;
    BakedQuad bakedquad;
    int j;

    for (Iterator iterator = p_175032_2_.iterator(); iterator.hasNext(); this.RenderHelper_B(p_175032_1_, bakedquad, j))
    {
        bakedquad = (BakedQuad)iterator.next();
        j = p_175032_3_;

        if (flag && bakedquad.func_178212_b())
        {
            j = p_175032_4_.getItem().getColorFromItemStack(p_175032_4_, bakedquad.func_178211_c());

            if (EntityRenderer.anaglyphEnable)
            {
                j = TextureUtil.func_177054_c(j);
            }

            j |= -16777216;
        }
    }
}
项目:PixelUtilities    文件:ConveyorRenderer.java   
private void renderConveyorWorld(IBlockAccess world, int x, int y, int z, Block block) {
    Tessellator tessellator = Tessellator.instance;
    int color = block.colorMultiplier(world, x, y, z);
    float red = (color >> 16 & 255) / 255.0F;
    float green = (color >> 8 & 255) / 255.0F;
    float blue = (color & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable) {
        float anaglyphRed = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
        float anaglyphGreen = (red * 30.0F + green * 70.0F) / 100.0F;
        float anaglyphBlue = (red * 30.0F + blue * 70.0F) / 100.0F;
        red = anaglyphRed;
        green = anaglyphGreen;
        blue = anaglyphBlue;
    }

    calculateVerts(world, x, y, z);

    tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
    tessellator.setColorOpaque_F(red, green, blue);
    draw(tessellator, block.getIcon(world, x, y, z, 0));
}
项目:ExpandedRailsMod    文件:Render.java   
/**
 * Renders an entity's name above its head
 */
protected void renderLivingLabel(T entityIn, String str, double x, double y, double z, int maxDistance)
{
    double d0 = entityIn.getDistanceSqToEntity(this.renderManager.renderViewEntity);

    if (d0 <= (double)(maxDistance * maxDistance))
    {
        boolean flag = entityIn.isSneaking();
        float f = this.renderManager.playerViewY;
        float f1 = this.renderManager.playerViewX;
        boolean flag1 = this.renderManager.options.thirdPersonView == 2;
        float f2 = entityIn.height + 0.5F - (flag ? 0.25F : 0.0F);
        int i = "deadmau5".equals(str) ? -10 : 0;
        EntityRenderer.func_189692_a(this.getFontRendererFromRenderManager(), str, (float)x, (float)y + f2, (float)z, i, f, f1, flag1, flag);
    }
}
项目:Corruption    文件:ClientProxy.java   
@Override
public void enableGrayscaleShader() {
    if (OpenGlHelper.shadersSupported) {
        Minecraft mc = Minecraft.getMinecraft();
        EntityRenderer entityRenderer = mc.entityRenderer;
        if (entityRenderer.theShaderGroup != null) {
            entityRenderer.theShaderGroup.deleteShaderGroup();
        }

        try {
            entityRenderer.theShaderGroup = new ShaderGroup(mc.getTextureManager(), mc.getResourceManager(), mc.getFramebuffer(), this.shader);
            entityRenderer.theShaderGroup.createBindFramebuffers(mc.displayWidth, mc.displayHeight);
        } catch (IOException ioexception) {
            Corruption.logger.warn("Failed to load shader: ", ioexception);
        }
    }
}
项目:Corruption    文件:ColourBlindCorruption.java   
@Override
public void onUpdate(EntityPlayer player, Side side) {
    if (side.isServer()) {
        this.playerCount.add(player.getCommandSenderName());
    }
    else if(side.isClient() && FMLClientHandler.instance().getClientPlayerEntity().getCommandSenderName().equals(player)) {
        curTick++;
        if(curTick == 10){
            curTick = 0;
            if (OpenGlHelper.shadersSupported) {
                EntityRenderer entityRenderer = Minecraft.getMinecraft().entityRenderer;
                if(entityRenderer.theShaderGroup.getShaderGroupName() != new ResourceLocation("corruption", "grayscale.json").toString()){
                    Corruption.proxy.enableGrayscaleShader();
                }
            }
        }
    }
}
项目:TechnicBlocks    文件:WorldLightingHandler.java   
@Override
public void preDrawFace(IRenderContext renderContext, ForgeDirection dir, boolean internal, float startX, float startY, float endX, float endY, RenderBlocks blocks, Tessellator tessellator, int rotations) {
    int multiplierValue = renderContext.getColorMultiplier();

    float colorR = (float)(multiplierValue >> 16 & 255) / 255.0F;
    float colorG = (float)(multiplierValue >> 8 & 255) / 255.0F;
    float colorB = (float)(multiplierValue & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float tempR = (colorR * 30.0F + colorG * 59.0F + colorB * 11.0F) / 100.0F;
        float tempG = (colorR * 30.0F + colorG * 70.0F) / 100.0F;
        float tempB = (colorR * 30.0F + colorB * 70.0F) / 100.0F;
        colorR = tempR;
        colorG = tempG;
        colorB = tempB;
    }

    if (Minecraft.isAmbientOcclusionEnabled() && renderContext.getLightValue() == 0)
        this.ambientOcclusionPreDraw(renderContext, dir, internal, blocks, tessellator, startX, startY, endX, endY, colorR, colorG, colorB, rotations);
    else
        this.colorMultiplierPreDraw(renderContext, dir, internal, blocks, tessellator, colorR, colorG, colorB);
}
项目:GardenCollection    文件:RenderHelper.java   
public static void calculateBaseColor (float[] target, int color) {
    float r = (float)(color >> 16 & 255) / 255f;
    float g = (float)(color >> 8 & 255) / 255f;
    float b = (float)(color & 255) / 255f;

    if (EntityRenderer.anaglyphEnable) {
        float gray = (r * 30f + g * 59f + b * 11f) / 100f;
        float rg = (r * 30f + g * 70f) / 100f;
        float rb = (r * 30f + b * 70f) / 100f;

        r = gray;
        g = rg;
        b = rb;
    }

    target[0] = r;
    target[1] = g;
    target[2] = b;
}
项目:GardenCollection    文件:HeavyChainRenderer.java   
private void renderCrossedSquares (RenderBlocks renderer, Block block, int x, int y, int z)
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.setBrightness(block.getMixedBrightnessForBlock(renderer.blockAccess, x, y, z));
    int l = block.colorMultiplier(renderer.blockAccess, x, y, z);
    float f = (float)(l >> 16 & 255) / 255.0F;
    float f1 = (float)(l >> 8 & 255) / 255.0F;
    float f2 = (float)(l & 255) / 255.0F;

    if (EntityRenderer.anaglyphEnable)
    {
        float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
        float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
        float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
        f = f3;
        f1 = f4;
        f2 = f5;
    }

    tessellator.setColorOpaque_F(f, f1, f2);

    IIcon iicon = renderer.getBlockIconFromSideAndMetadata(block, 0, renderer.blockAccess.getBlockMetadata(x, y, z));
    drawCrossedSquares(renderer, iicon, x, y, z, 1.0F);
}
项目:RuneCraftery    文件:RenderBlocks.java   
public boolean func_85096_a(BlockAnvil p_85096_1_, int p_85096_2_, int p_85096_3_, int p_85096_4_, int p_85096_5_) {
   Tessellator var6 = Tessellator.field_78398_a;
   var6.func_78380_c(p_85096_1_.func_71874_e(this.field_78669_a, p_85096_2_, p_85096_3_, p_85096_4_));
   float var7 = 1.0F;
   int var8 = p_85096_1_.func_71920_b(this.field_78669_a, p_85096_2_, p_85096_3_, p_85096_4_);
   float var9 = (float)(var8 >> 16 & 255) / 255.0F;
   float var10 = (float)(var8 >> 8 & 255) / 255.0F;
   float var11 = (float)(var8 & 255) / 255.0F;
   if(EntityRenderer.field_78517_a) {
      float var12 = (var9 * 30.0F + var10 * 59.0F + var11 * 11.0F) / 100.0F;
      float var13 = (var9 * 30.0F + var10 * 70.0F) / 100.0F;
      float var14 = (var9 * 30.0F + var11 * 70.0F) / 100.0F;
      var9 = var12;
      var10 = var13;
      var11 = var14;
   }

   var6.func_78386_a(var7 * var9, var7 * var10, var7 * var11);
   return this.func_82776_a(p_85096_1_, p_85096_2_, p_85096_3_, p_85096_4_, p_85096_5_, false);
}
项目:RuneCraftery    文件:RenderBlocks.java   
public boolean func_78570_q(Block p_78570_1_, int p_78570_2_, int p_78570_3_, int p_78570_4_) {
   int var5 = p_78570_1_.func_71920_b(this.field_78669_a, p_78570_2_, p_78570_3_, p_78570_4_);
   float var6 = (float)(var5 >> 16 & 255) / 255.0F;
   float var7 = (float)(var5 >> 8 & 255) / 255.0F;
   float var8 = (float)(var5 & 255) / 255.0F;
   if(EntityRenderer.field_78517_a) {
      float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F;
      float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F;
      float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F;
      var6 = var9;
      var7 = var10;
      var8 = var11;
   }

   return Minecraft.func_71379_u() && Block.field_71984_q[p_78570_1_.field_71990_ca] == 0?(this.field_98189_n?this.func_102027_b(p_78570_1_, p_78570_2_, p_78570_3_, p_78570_4_, var6, var7, var8):this.func_78578_a(p_78570_1_, p_78570_2_, p_78570_3_, p_78570_4_, var6, var7, var8)):this.func_78609_c(p_78570_1_, p_78570_2_, p_78570_3_, p_78570_4_, var6, var7, var8);
}
项目:RuneCraftery    文件:RenderBlocks.java   
public boolean func_78584_s(Block p_78584_1_, int p_78584_2_, int p_78584_3_, int p_78584_4_) {
   int var5 = p_78584_1_.func_71920_b(this.field_78669_a, p_78584_2_, p_78584_3_, p_78584_4_);
   float var6 = (float)(var5 >> 16 & 255) / 255.0F;
   float var7 = (float)(var5 >> 8 & 255) / 255.0F;
   float var8 = (float)(var5 & 255) / 255.0F;
   if(EntityRenderer.field_78517_a) {
      float var9 = (var6 * 30.0F + var7 * 59.0F + var8 * 11.0F) / 100.0F;
      float var10 = (var6 * 30.0F + var7 * 70.0F) / 100.0F;
      float var11 = (var6 * 30.0F + var8 * 70.0F) / 100.0F;
      var6 = var9;
      var7 = var10;
      var8 = var11;
   }

   return this.func_78569_d(p_78584_1_, p_78584_2_, p_78584_3_, p_78584_4_, var6, var7, var8);
}
项目:RuneCraftery    文件:RenderBlocks.java   
public boolean func_94172_a(BlockHopper p_94172_1_, int p_94172_2_, int p_94172_3_, int p_94172_4_) {
   Tessellator var5 = Tessellator.field_78398_a;
   var5.func_78380_c(p_94172_1_.func_71874_e(this.field_78669_a, p_94172_2_, p_94172_3_, p_94172_4_));
   float var6 = 1.0F;
   int var7 = p_94172_1_.func_71920_b(this.field_78669_a, p_94172_2_, p_94172_3_, p_94172_4_);
   float var8 = (float)(var7 >> 16 & 255) / 255.0F;
   float var9 = (float)(var7 >> 8 & 255) / 255.0F;
   float var10 = (float)(var7 & 255) / 255.0F;
   if(EntityRenderer.field_78517_a) {
      float var11 = (var8 * 30.0F + var9 * 59.0F + var10 * 11.0F) / 100.0F;
      float var12 = (var8 * 30.0F + var9 * 70.0F) / 100.0F;
      float var13 = (var8 * 30.0F + var10 * 70.0F) / 100.0F;
      var8 = var11;
      var9 = var12;
      var10 = var13;
   }

   var5.func_78386_a(var6 * var8, var6 * var9, var6 * var10);
   return this.func_96447_a(p_94172_1_, p_94172_2_, p_94172_3_, p_94172_4_, this.field_78669_a.func_72805_g(p_94172_2_, p_94172_3_, p_94172_4_), false);
}
项目:ForestryLegacy    文件:SaplingRenderHandler.java   
protected boolean renderCrossedSquares(IAlleleTreeSpecies species, IBlockAccess world, Block block, int x, int y, int z) {

        Tessellator tess = Tessellator.instance;
        tess.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
        int colourMultiplier = block.colorMultiplier(world, x, y, z);
        float r = (colourMultiplier >> 16 & 255) / 255.0F;
        float g = (colourMultiplier >> 8 & 255) / 255.0F;
        float b = (colourMultiplier & 255) / 255.0F;

        if (EntityRenderer.anaglyphEnable) {

            r = (r * 30.0F + g * 59.0F + b * 11.0F) / 100.0F;
            g = (r * 30.0F + g * 70.0F) / 100.0F;
            b = (r * 30.0F + b * 70.0F) / 100.0F;
        }

        tess.setColorOpaque_F(r, g, b);
        drawCrossedSquares(world, block, x, y, z, x, y, z);
        return true;
    }