当前位置: 首页>>代码示例>>Java>>正文


Java GlStateManager.alphaFunc方法代码示例

本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.alphaFunc方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.alphaFunc方法的具体用法?Java GlStateManager.alphaFunc怎么用?Java GlStateManager.alphaFunc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.renderer.GlStateManager的用法示例。


在下文中一共展示了GlStateManager.alphaFunc方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderBeacon

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderBeacon(double p_188206_1_, double p_188206_3_, double p_188206_5_, double p_188206_7_, double p_188206_9_, List<TileEntityBeacon.BeamSegment> p_188206_11_, double p_188206_12_)
{
    GlStateManager.alphaFunc(516, 0.1F);
    this.bindTexture(TEXTURE_BEACON_BEAM);

    if (p_188206_9_ > 0.0D)
    {
        GlStateManager.disableFog();
        int i = 0;

        for (int j = 0; j < p_188206_11_.size(); ++j)
        {
            TileEntityBeacon.BeamSegment tileentitybeacon$beamsegment = (TileEntityBeacon.BeamSegment)p_188206_11_.get(j);
            renderBeamSegment(p_188206_1_, p_188206_3_, p_188206_5_, p_188206_7_, p_188206_9_, p_188206_12_, i, tileentitybeacon$beamsegment.getHeight(), tileentitybeacon$beamsegment.getColors());
            i += tileentitybeacon$beamsegment.getHeight();
        }

        GlStateManager.enableFog();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:TileEntityBeaconRenderer.java

示例2: renderTick

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void renderTick(float partialTicks)
{
    Minecraft.getMinecraft().mcProfiler.startSection("expParticleDraw");
    Minecraft.getMinecraft().renderEngine.bindTexture(ExPTextures.PARTICLES);
    BufferBuilder bb = Tessellator.getInstance().getBuffer();
    GlStateManager.disableAlpha();
    GlStateManager.disableBlend();
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.SOLID).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.CUTOUT).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    bb.begin(GL11.GL_QUADS, this.getDrawFormat());
    particles.get(BlockRenderLayer.TRANSLUCENT).forEach(p -> p.draw(bb, partialTicks, ActiveRenderInfo.getRotationX(), ActiveRenderInfo.getRotationXZ(), ActiveRenderInfo.getRotationZ(), ActiveRenderInfo.getRotationYZ(), ActiveRenderInfo.getRotationXY()));
    Tessellator.getInstance().draw();
    Minecraft.getMinecraft().mcProfiler.endSection();
}
 
开发者ID:V0idWa1k3r,项目名称:ExPetrum,代码行数:24,代码来源:ParticleEngine.java

示例3: renderItemIntoGUI

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderItemIntoGUI(ItemStack stack, int x, int y)
{
    IBakedModel ibakedmodel = this.itemModelMesher.getItemModel(stack);
    GlStateManager.pushMatrix();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(770, 771);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.setupGuiTransform(x, y, ibakedmodel.isGui3d());
    ibakedmodel.getItemCameraTransforms().applyTransform(ItemCameraTransforms.TransformType.GUI);
    this.renderItem(stack, ibakedmodel);
    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:23,代码来源:RenderItem.java

示例4: renderName

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderName(T entity, double x, double y, double z)
{
    if (!Reflector.RenderLivingEvent_Specials_Pre_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Pre_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
    {
        if (this.canRenderName(entity))
        {
            double d0 = entity.getDistanceSqToEntity(this.renderManager.renderViewEntity);
            float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;

            if (d0 < (double)(f * f))
            {
                String s = entity.getDisplayName().getFormattedText();
                GlStateManager.alphaFunc(516, 0.1F);
                this.renderEntityName(entity, x, y, z, s, d0);
            }
        }

        if (!Reflector.RenderLivingEvent_Specials_Post_Constructor.exists() || !Reflector.postForgeBusEvent(Reflector.RenderLivingEvent_Specials_Post_Constructor, new Object[] {entity, this, Double.valueOf(x), Double.valueOf(y), Double.valueOf(z)}))
        {
            ;
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:RenderLivingBase.java

示例5: renderName

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderName(T entity, double x, double y, double z)
{
    if (net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Pre<T>(entity, this, x, y, z))) return;
    if (this.canRenderName(entity))
    {
        double d0 = entity.getDistanceSqToEntity(this.renderManager.renderViewEntity);
        float f = entity.isSneaking() ? NAME_TAG_RANGE_SNEAK : NAME_TAG_RANGE;

        if (d0 < (double)(f * f))
        {
            String s = entity.getDisplayName().getFormattedText();
            GlStateManager.alphaFunc(516, 0.1F);
            this.renderEntityName(entity, x, y, z, s, d0);
        }
    }
    net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.RenderLivingEvent.Specials.Post<T>(entity, this, x, y, z));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:RenderLivingBase.java

示例6: renderItemModelTransform

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void renderItemModelTransform(ItemStack stack, IBakedModel model, ItemCameraTransforms.TransformType cameraTransformType)
{
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).setBlurMipmap(false, false);
    this.preTransform(stack);
    GlStateManager.enableRescaleNormal();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableBlend();
    GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
    GlStateManager.pushMatrix();
    ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms();
    itemcameratransforms.applyTransform(cameraTransformType);

    if (this.func_183005_a(itemcameratransforms.getTransform(cameraTransformType)))
    {
        GlStateManager.cullFace(1028);
    }

    this.renderItem(stack, model);
    GlStateManager.cullFace(1029);
    GlStateManager.popMatrix();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableBlend();
    this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
    this.textureManager.getTexture(TextureMap.locationBlocksTexture).restoreLastBlurMipmap();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:27,代码来源:RenderItem.java

示例7: renderItemModelIntoGUI

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private static void renderItemModelIntoGUI(ItemStack stack, double x, double y, IBakedModel bakedmodel, double scale)
{
    GlStateManager.pushMatrix();
    MC.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    MC.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).setBlurMipmap(false, false);
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableBlend();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

    GlStateManager.translate(x, y, 100.0F + MC.getRenderItem().zLevel);
    GlStateManager.translate(8.0F, 8.0F, 0.0F);
    GlStateManager.scale(1.0F, -1.0F, 1.0F);
    GlStateManager.scale(scale, scale, scale);

    if (bakedmodel.isGui3d())
        GlStateManager.enableLighting();
    else
        GlStateManager.disableLighting();

    bakedmodel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(bakedmodel, ItemCameraTransforms.TransformType.GUI, false);
    MC.getRenderItem().renderItem(stack, bakedmodel);
    GlStateManager.disableAlpha();
    GlStateManager.disableRescaleNormal();
    GlStateManager.disableLighting();
    GlStateManager.popMatrix();
    MC.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    MC.getTextureManager().getTexture(TextureMap.LOCATION_BLOCKS_TEXTURE).restoreLastBlurMipmap();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:32,代码来源:SurfaceHelper.java

示例8: renderItemWithTransform

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void renderItemWithTransform(World world, ItemStack stack,
		ItemCameraTransforms.TransformType transform)
{
	GlStateManager.pushMatrix();
	GlStateManager.pushAttrib();
	GlStateManager.enableCull();
	GlStateManager.depthMask(true);
	RenderHelper.enableStandardItemLighting();
	GlStateManager.enableAlpha();
	GlStateManager.enableRescaleNormal();
	GlStateManager.alphaFunc(516, 0.1F);
	GlStateManager.enableBlend();
	GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA,
			GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE,
			GlStateManager.DestFactor.ZERO);

	IBakedModel ibakedmodel = Minecraft.getMinecraft().getRenderItem().getItemModelWithOverrides(stack, world,
			(EntityLivingBase) null);
	IBakedModel transformedModel = net.minecraftforge.client.ForgeHooksClient.handleCameraTransforms(ibakedmodel,
			transform, false);
	Minecraft.getMinecraft().getRenderItem().renderItem(stack, transformedModel);

	GlStateManager.disableBlend();
	GlStateManager.disableAlpha();
	RenderHelper.disableStandardItemLighting();
	GlStateManager.depthMask(false);
	GlStateManager.disableCull();
	GlStateManager.popAttrib();
	GlStateManager.popMatrix();
}
 
开发者ID:raphydaphy,项目名称:ArcaneMagic,代码行数:31,代码来源:GLHelper.java

示例9: renderModel

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the model in RenderLiving
 */
protected void renderModel(T entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
{
    boolean flag = !entitylivingbaseIn.isInvisible();
    boolean flag1 = !flag && !entitylivingbaseIn.isInvisibleToPlayer(Minecraft.getMinecraft().thePlayer);

    if (flag || flag1)
    {
        if (!this.bindEntityTexture(entitylivingbaseIn))
        {
            return;
        }

        if (flag1)
        {
            GlStateManager.pushMatrix();
            GlStateManager.color(1.0F, 1.0F, 1.0F, 0.15F);
            GlStateManager.depthMask(false);
            GlStateManager.enableBlend();
            GlStateManager.blendFunc(770, 771);
            GlStateManager.alphaFunc(516, 0.003921569F);
        }

        this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);

        if (flag1)
        {
            GlStateManager.disableBlend();
            GlStateManager.alphaFunc(516, 0.1F);
            GlStateManager.popMatrix();
            GlStateManager.depthMask(true);
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:37,代码来源:RendererLivingEntity.java

示例10: renderModel

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the model in RenderLiving
 */
protected void renderModel(EntityDragon entitylivingbaseIn, float p_77036_2_, float p_77036_3_, float p_77036_4_, float p_77036_5_, float p_77036_6_, float p_77036_7_)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        float f = (float)entitylivingbaseIn.deathTicks / 200.0F;
        GlStateManager.depthFunc(515);
        GlStateManager.enableAlpha();
        GlStateManager.alphaFunc(516, f);
        this.bindTexture(enderDragonExplodingTextures);
        this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
        GlStateManager.alphaFunc(516, 0.1F);
        GlStateManager.depthFunc(514);
    }

    this.bindEntityTexture(entitylivingbaseIn);
    this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);

    if (entitylivingbaseIn.hurtTime > 0)
    {
        GlStateManager.depthFunc(514);
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(770, 771);
        GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F);
        this.mainModel.render(entitylivingbaseIn, p_77036_2_, p_77036_3_, p_77036_4_, p_77036_5_, p_77036_6_, p_77036_7_);
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
        GlStateManager.depthFunc(515);
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:34,代码来源:RenderDragon.java

示例11: beginSpiderEyes

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void beginSpiderEyes()
{
    if (isRenderingWorld && programsID[18] != programsID[0])
    {
        useProgram(18);
        GlStateManager.enableAlpha();
        GlStateManager.alphaFunc(516, 0.0F);
        GlStateManager.blendFunc(770, 771);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:11,代码来源:Shaders.java

示例12: renderModel

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the model in RenderLiving
 */
protected void renderModel(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor)
{
    if (entitylivingbaseIn.deathTicks > 0)
    {
        float f = (float)entitylivingbaseIn.deathTicks / 200.0F;
        GlStateManager.depthFunc(515);
        GlStateManager.enableAlpha();
        GlStateManager.alphaFunc(516, f);
        this.bindTexture(DRAGON_EXPLODING_TEXTURES);
        this.mainModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
        GlStateManager.alphaFunc(516, 0.1F);
        GlStateManager.depthFunc(514);
    }

    this.bindEntityTexture(entitylivingbaseIn);
    this.mainModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);

    if (entitylivingbaseIn.hurtTime > 0)
    {
        GlStateManager.depthFunc(514);
        GlStateManager.disableTexture2D();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        GlStateManager.color(1.0F, 0.0F, 0.0F, 0.5F);
        this.mainModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor);
        GlStateManager.enableTexture2D();
        GlStateManager.disableBlend();
        GlStateManager.depthFunc(515);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:RenderDragon.java

示例13: preRenderDamagedBlocks

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void preRenderDamagedBlocks() {
    GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.DST_COLOR, GlStateManager.DestFactor.SRC_COLOR, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
    GlStateManager.enableBlend();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 0.5F);
    GlStateManager.doPolygonOffset(-3.0F, -3.0F);
    GlStateManager.enablePolygonOffset();
    GlStateManager.alphaFunc(516, 0.1F);
    GlStateManager.enableAlpha();
    GlStateManager.pushMatrix();
}
 
开发者ID:the-realest-stu,项目名称:Adventurers-Toolbox,代码行数:11,代码来源:ExtraBlockBreakHandler.java

示例14: drawSplashScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void drawSplashScreen(TextureManager textureManagerInstance) throws LWJGLException
{
    ScaledResolution scaledresolution = new ScaledResolution(this);
    int i = scaledresolution.getScaleFactor();
    Framebuffer framebuffer = new Framebuffer(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i, true);
    framebuffer.bindFramebuffer(false);
    GlStateManager.matrixMode(5889);
    GlStateManager.loadIdentity();
    GlStateManager.ortho(0.0D, (double)scaledresolution.getScaledWidth(), (double)scaledresolution.getScaledHeight(), 0.0D, 1000.0D, 3000.0D);
    GlStateManager.matrixMode(5888);
    GlStateManager.loadIdentity();
    GlStateManager.translate(0.0F, 0.0F, -2000.0F);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    GlStateManager.disableDepth();
    GlStateManager.enableTexture2D();
    InputStream inputstream = null;

    try
    {
        inputstream = this.mcDefaultResourcePack.getInputStream(LOCATION_MOJANG_PNG);
        this.mojangLogo = textureManagerInstance.getDynamicTextureLocation("logo", new DynamicTexture(ImageIO.read(inputstream)));
        textureManagerInstance.bindTexture(this.mojangLogo);
    }
    catch (IOException ioexception)
    {
        LOGGER.error("Unable to load logo: {}", new Object[] {LOCATION_MOJANG_PNG, ioexception});
    }
    finally
    {
        IOUtils.closeQuietly(inputstream);
    }

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    vertexbuffer.pos(0.0D, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos((double)this.displayWidth, (double)this.displayHeight, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos((double)this.displayWidth, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    vertexbuffer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    int j = 256;
    int k = 256;
    this.draw((scaledresolution.getScaledWidth() - 256) / 2, (scaledresolution.getScaledHeight() - 256) / 2, 0, 0, 256, 256, 255, 255, 255, 255);
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    framebuffer.unbindFramebuffer();
    framebuffer.framebufferRender(scaledresolution.getScaledWidth() * i, scaledresolution.getScaledHeight() * i);
    GlStateManager.enableAlpha();
    GlStateManager.alphaFunc(516, 0.1F);
    this.updateDisplay();
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:54,代码来源:Minecraft.java

示例15: renderName

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void renderName(T entity, double x, double y, double z)
{
    if (this.canRenderName(entity))
    {
        double d0 = entity.getDistanceSqToEntity(this.renderManager.livingPlayer);
        float f = entity.isSneaking() ? 32.0F : 64.0F;

        if (d0 < (double)(f * f))
        {
            String s = entity.getDisplayName().getFormattedText();
            float f1 = 0.02666667F;
            GlStateManager.alphaFunc(516, 0.1F);

            if (entity.isSneaking())
            {
                FontRenderer fontrenderer = this.getFontRendererFromRenderManager();
                GlStateManager.pushMatrix();
                GlStateManager.translate((float)x, (float)y + entity.height + 0.5F - (entity.isChild() ? entity.height / 2.0F : 0.0F), (float)z);
                GL11.glNormal3f(0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
                GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
                GlStateManager.scale(-0.02666667F, -0.02666667F, 0.02666667F);
                GlStateManager.translate(0.0F, 9.374999F, 0.0F);
                GlStateManager.disableLighting();
                GlStateManager.depthMask(false);
                GlStateManager.enableBlend();
                GlStateManager.disableTexture2D();
                GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
                int i = fontrenderer.getStringWidth(s) / 2;
                Tessellator tessellator = Tessellator.getInstance();
                WorldRenderer worldrenderer = tessellator.getWorldRenderer();
                worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
                worldrenderer.pos((double)(-i - 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(-i - 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), 8.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                worldrenderer.pos((double)(i + 1), -1.0D, 0.0D).color(0.0F, 0.0F, 0.0F, 0.25F).endVertex();
                tessellator.draw();
                GlStateManager.enableTexture2D();
                GlStateManager.depthMask(true);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, 0, 553648127);
                GlStateManager.enableLighting();
                GlStateManager.disableBlend();
                GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
                GlStateManager.popMatrix();
            }
            else
            {
                this.renderOffsetLivingLabel(entity, x, y - (entity.isChild() ? (double)(entity.height / 2.0F) : 0.0D), z, s, 0.02666667F, d0);
            }
        }
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:53,代码来源:RendererLivingEntity.java


注:本文中的net.minecraft.client.renderer.GlStateManager.alphaFunc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。