當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。