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


Java GlStateManager.color方法代码示例

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


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

示例1: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    IBlockState iblockstate = entitylivingbaseIn.getHeldBlockState();

    if (iblockstate != null)
    {
        BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
        GlStateManager.enableRescaleNormal();
        GlStateManager.pushMatrix();
        GlStateManager.translate(0.0F, 0.6875F, -0.75F);
        GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F);
        GlStateManager.translate(0.25F, 0.1875F, 0.25F);
        float f = 0.5F;
        GlStateManager.scale(-0.5F, -0.5F, 0.5F);
        int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
        int j = i % 65536;
        int k = i / 65536;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.endermanRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        blockrendererdispatcher.renderBlockBrightness(iblockstate, 1.0F);
        GlStateManager.popMatrix();
        GlStateManager.disableRescaleNormal();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:LayerHeldBlock.java

示例2: renderParticle

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the particle
 */
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
    if (this.entity != null)
    {
        RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
        rendermanager.setRenderPosition(Particle.interpPosX, Particle.interpPosY, Particle.interpPosZ);
        float f = 0.42553192F;
        float f1 = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge;
        GlStateManager.depthMask(true);
        GlStateManager.enableBlend();
        GlStateManager.enableDepth();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        float f2 = 240.0F;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
        GlStateManager.pushMatrix();
        float f3 = 0.05F + 0.5F * MathHelper.sin(f1 * (float)Math.PI);
        GlStateManager.color(1.0F, 1.0F, 1.0F, f3);
        GlStateManager.translate(0.0F, 1.8F, 0.0F);
        GlStateManager.rotate(180.0F - entityIn.rotationYaw, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(60.0F - 150.0F * f1 - entityIn.rotationPitch, 1.0F, 0.0F, 0.0F);
        GlStateManager.translate(0.0F, -0.4F, -1.5F);
        GlStateManager.scale(0.42553192F, 0.42553192F, 0.42553192F);
        this.entity.rotationYaw = 0.0F;
        this.entity.rotationYawHead = 0.0F;
        this.entity.prevRotationYaw = 0.0F;
        this.entity.prevRotationYawHead = 0.0F;
        rendermanager.doRenderEntity(this.entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
        GlStateManager.popMatrix();
        GlStateManager.enableDepth();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:ParticleMobAppearance.java

示例3: drawGuiContainerBackgroundLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Args : renderPartialTicks, mouseX, mouseY
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(horseGuiTextures);
    int i = (this.width - this.xSize) / 2;
    int j = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);

    if (this.horseEntity.isChested())
    {
        this.drawTexturedModalRect(i + 79, j + 17, 0, this.ySize, 90, 54);
    }

    if (this.horseEntity.canWearArmor())
    {
        this.drawTexturedModalRect(i + 7, j + 35, 0, this.ySize + 54, 18, 18);
    }

    GuiInventory.drawEntityOnScreen(i + 51, j + 60, 17, (float)(i + 51) - this.mousePosx, (float)(j + 75 - 50) - this.mousePosY, this.horseEntity);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:24,代码来源:GuiScreenHorseInventory.java

示例4: func_148224_c

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void func_148224_c(int p_148224_1_, int p_148224_2_, int p_148224_3_, int p_148224_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(Gui.statIcons);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 18) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 18), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 18) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
    worldrenderer.pos((double)(p_148224_1_ + 0), (double)(p_148224_2_ + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(p_148224_3_ + 0) * 0.0078125F), (double)((float)(p_148224_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:18,代码来源:GuiCreateFlatWorld.java

示例5: drawButton

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws this button to the screen.
 */
public void drawButton(Minecraft mc, int mouseX, int mouseY)
{
    if (this.visible)
    {
        boolean flag = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        mc.getTextureManager().bindTexture(GuiScreenBook.BOOK_GUI_TEXTURES);
        int i = 0;
        int j = 192;

        if (flag)
        {
            i += 23;
        }

        if (!this.isForward)
        {
            j += 13;
        }

        this.drawTexturedModalRect(this.xPosition, this.yPosition, i, j, 23, 13);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:27,代码来源:GuiScreenBook.java

示例6: drawGuiContainerForegroundLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerForegroundLayer(int mx, int my) {
    if(title)
        this.fontRendererObj.drawString(this.name, this.xSize / 2 - this.fontRendererObj.getStringWidth(this.name) / 2, 6, 0xa0a0a0);
    
    GlStateManager.pushAttrib();
    GlStateManager.color(1, 1, 1, 1);
    
    Minecraft.getMinecraft().renderEngine.bindTexture(getTexture());
    GlStateManager.popAttrib();

    if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && getShouldOutline() != null)
        drawOutlines();
}
 
开发者ID:jaredlll08,项目名称:Machines-and-Stuff,代码行数:15,代码来源:GuiBase.java

示例7: drawIcon

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private static void drawIcon()
{
    if(!Twitchy.persistantIcon && !Twitchy.isLive) return;
    GlStateManager.color(1f, 1f, 1f, 1f);
    GlStateManager.enableBlend();
    mc.getTextureManager().bindTexture(twitch);
    GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textU, textV, twitchRect.width, twitchRect.height, 0);
    if(Twitchy.isLive)
        GuiUtils.drawTexturedModalRect(twitchRect.x, twitchRect.y, textLU, textLV, twitchRect.width, twitchRect.height, 0);
}
 
开发者ID:OCDiary,项目名称:Twitchy,代码行数:11,代码来源:TCDrawScreen.java

示例8: drawGuiContainerBackgroundLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Args : renderPartialTicks, mouseX, mouseY
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(craftingTableGuiTextures);
    int i = (this.width - this.xSize) / 2;
    int j = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:GuiCrafting.java

示例9: drawGuiContainerBackgroundLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Args : renderPartialTicks, mouseX, mouseY
 */
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(HOPPER_GUI_TEXTURE);
    int i = (this.width - this.xSize) / 2;
    int j = (this.height - this.ySize) / 2;
    this.drawTexturedModalRect(i, j, 0, 0, this.xSize, this.ySize);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:GuiHopper.java

示例10: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntitySlime entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    if (!entitylivingbaseIn.isInvisible())
    {
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableNormalize();
        GlStateManager.enableBlend();
        GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
        this.slimeModel.setModelAttributes(this.slimeRenderer.getMainModel());
        this.slimeModel.render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
        GlStateManager.disableBlend();
        GlStateManager.disableNormalize();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:LayerSlimeGel.java

示例11: renderTooltip

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void renderTooltip(ScaledResolution sr, float partialTicks)
{
    if (this.mc.getRenderViewEntity() instanceof EntityPlayer)
    {
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.mc.getTextureManager().bindTexture(widgetsTexPath);
        EntityPlayer entityplayer = (EntityPlayer)this.mc.getRenderViewEntity();
        int i = sr.getScaledWidth() / 2;
        float f = this.zLevel;
        this.zLevel = -90.0F;
        this.drawTexturedModalRect(i - 91, sr.getScaledHeight() - 22, 0, 0, 182, 22);
        this.drawTexturedModalRect(i - 91 - 1 + entityplayer.inventory.currentItem * 20, sr.getScaledHeight() - 22 - 1, 0, 22, 24, 22);
        this.zLevel = f;
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableBlend();
        GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
        RenderHelper.enableGUIStandardItemLighting();

        for (int j = 0; j < 9; ++j)
        {
            int k = sr.getScaledWidth() / 2 - 90 + j * 20 + 2;
            int l = sr.getScaledHeight() - 16 - 3;
            this.renderHotbarItem(j, k, l, partialTicks, entityplayer);
        }

        RenderHelper.disableStandardItemLighting();
        GlStateManager.disableRescaleNormal();
        GlStateManager.disableBlend();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:31,代码来源:GuiIngame.java

示例12: preRenderCallback

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityGhast entitylivingbaseIn, float partialTickTime)
{
    float f = 1.0F;
    float f1 = (8.0F + f) / 2.0F;
    float f2 = (8.0F + 1.0F / f) / 2.0F;
    GlStateManager.scale(f2, f1, f2);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:13,代码来源:RenderGhast.java

示例13: framebufferRenderExt

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void framebufferRenderExt(int p_178038_1_, int p_178038_2_, boolean p_178038_3_)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        GlStateManager.colorMask(true, true, true, false);
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        GlStateManager.matrixMode(5889);
        GlStateManager.loadIdentity();
        GlStateManager.ortho(0.0D, (double)p_178038_1_, (double)p_178038_2_, 0.0D, 1000.0D, 3000.0D);
        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -2000.0F);
        GlStateManager.viewport(0, 0, p_178038_1_, p_178038_2_);
        GlStateManager.enableTexture2D();
        GlStateManager.disableLighting();
        GlStateManager.disableAlpha();

        if (p_178038_3_)
        {
            GlStateManager.disableBlend();
            GlStateManager.enableColorMaterial();
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.bindFramebufferTexture();
        float f = (float)p_178038_1_;
        float f1 = (float)p_178038_2_;
        float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
        float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
        Tessellator tessellator = Tessellator.getInstance();
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
        worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
        worldrenderer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
        worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)f3).color(255, 255, 255, 255).endVertex();
        tessellator.draw();
        this.unbindFramebufferTexture();
        GlStateManager.depthMask(true);
        GlStateManager.colorMask(true, true, true, true);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:44,代码来源:Framebuffer.java

示例14: renderHUDEffect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void renderHUDEffect(int x, int y, PotionEffect effect, Minecraft mc, float alpha) {
	mc.renderEngine.bindTexture(TEXTURE_TIPSY);
	GlStateManager.color(1, 1, 1, alpha);
	Gui.drawModalRectWithCustomSizedTexture(x+3, y+3, 0, 0, 18, 18, 18, 18);
}
 
开发者ID:elytra,项目名称:Thermionics,代码行数:7,代码来源:PotionTipsy.java

示例15: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityLivingBase entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    ItemStack itemstack = entitylivingbaseIn.getItemStackFromSlot(EntityEquipmentSlot.HEAD);

    if (!itemstack.func_190926_b())
    {
        Item item = itemstack.getItem();
        Minecraft minecraft = Minecraft.getMinecraft();
        GlStateManager.pushMatrix();

        if (entitylivingbaseIn.isSneaking())
        {
            GlStateManager.translate(0.0F, 0.2F, 0.0F);
        }

        boolean flag = entitylivingbaseIn instanceof EntityVillager || entitylivingbaseIn instanceof EntityZombieVillager;

        if (entitylivingbaseIn.isChild() && !(entitylivingbaseIn instanceof EntityVillager))
        {
            float f = 2.0F;
            float f1 = 1.4F;
            GlStateManager.translate(0.0F, 0.5F * scale, 0.0F);
            GlStateManager.scale(0.7F, 0.7F, 0.7F);
            GlStateManager.translate(0.0F, 16.0F * scale, 0.0F);
        }

        this.modelRenderer.postRender(0.0625F);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);

        if (item == Items.SKULL)
        {
            float f2 = 1.1875F;
            GlStateManager.scale(1.1875F, -1.1875F, -1.1875F);

            if (flag)
            {
                GlStateManager.translate(0.0F, 0.0625F, 0.0F);
            }

            GameProfile gameprofile = null;

            if (itemstack.hasTagCompound())
            {
                NBTTagCompound nbttagcompound = itemstack.getTagCompound();

                if (nbttagcompound.hasKey("SkullOwner", 10))
                {
                    gameprofile = NBTUtil.readGameProfileFromNBT(nbttagcompound.getCompoundTag("SkullOwner"));
                }
                else if (nbttagcompound.hasKey("SkullOwner", 8))
                {
                    String s = nbttagcompound.getString("SkullOwner");

                    if (!StringUtils.isBlank(s))
                    {
                        gameprofile = TileEntitySkull.updateGameprofile(new GameProfile((UUID)null, s));
                        nbttagcompound.setTag("SkullOwner", NBTUtil.writeGameProfile(new NBTTagCompound(), gameprofile));
                    }
                }
            }

            TileEntitySkullRenderer.instance.renderSkull(-0.5F, 0.0F, -0.5F, EnumFacing.UP, 180.0F, itemstack.getMetadata(), gameprofile, -1, limbSwing);
        }
        else if (!(item instanceof ItemArmor) || ((ItemArmor)item).getEquipmentSlot() != EntityEquipmentSlot.HEAD)
        {
            float f3 = 0.625F;
            GlStateManager.translate(0.0F, -0.25F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
            GlStateManager.scale(0.625F, -0.625F, -0.625F);

            if (flag)
            {
                GlStateManager.translate(0.0F, 0.1875F, 0.0F);
            }

            minecraft.getItemRenderer().renderItem(entitylivingbaseIn, itemstack, ItemCameraTransforms.TransformType.HEAD);
        }

        GlStateManager.popMatrix();
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:82,代码来源:LayerCustomHead.java


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