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


Java GlStateManager.enableColorMaterial方法代码示例

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


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

示例1: drawPotionEffect

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void drawPotionEffect(PotionEffect potion, int x, int y) {
    int index = potion.getPotion().getStatusIconIndex();
    GlStateManager.pushMatrix();
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.disableLighting();
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableColorMaterial();
    GlStateManager.enableLighting();
    GlStateManager.enableTexture2D();
    GlStateManager.color(1.f, 1.f, 1.f, 1.f);
    MC.getTextureManager().bindTexture(GuiContainer.INVENTORY_BACKGROUND);
    drawTexturedRect(x, y, index % 8 * 18, 198 + index / 8 * 18, 18, 18, 100);
    potion.getPotion().renderHUDEffect(x, y, potion, MC, 255);
    GlStateManager.disableLighting();
    GlStateManager.enableDepth();
    GlStateManager.color(1.f, 1.f, 1.f, 1.f);
    GlStateManager.popMatrix();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:19,代码来源:SurfaceHelper.java

示例2: doRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityWitherSkull entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.disableCull();
    float f = this.getRenderYaw(entity.prevRotationYaw, entity.rotationYaw, partialTicks);
    float f1 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f2 = 0.0625F;
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(-1.0F, -1.0F, 1.0F);
    GlStateManager.enableAlpha();
    this.bindEntityTexture(entity);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    this.skeletonHeadModel.render(entity, 0.0F, 0.0F, 0.0F, f, f1, 0.0625F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:RenderWitherSkull.java

示例3: enableItemRendering

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public static void enableItemRendering() {
    RenderHelper.enableGUIStandardItemLighting();
    GlStateManager.disableLighting();
    GlStateManager.enableRescaleNormal();
    GlStateManager.enableColorMaterial();
    GlStateManager.enableLighting();
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:8,代码来源:SurfaceBuilder.java

示例4: drawEntityOnScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws the entity to the screen. Args: xPos, yPos, scale, mouseX, mouseY, entityLiving
 */
public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent)
{
    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)posX, (float)posY, 50.0F);
    GlStateManager.scale((float)(-scale), (float)scale, (float)scale);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    float f = ent.renderYawOffset;
    float f1 = ent.rotationYaw;
    float f2 = ent.rotationPitch;
    float f3 = ent.prevRotationYawHead;
    float f4 = ent.rotationYawHead;
    GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
    ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F;
    ent.rotationYaw = (float)Math.atan((double)(mouseX / 40.0F)) * 40.0F;
    ent.rotationPitch = -((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F;
    ent.rotationYawHead = ent.rotationYaw;
    ent.prevRotationYawHead = ent.rotationYaw;
    GlStateManager.translate(0.0F, 0.0F, 0.0F);
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    rendermanager.setPlayerViewY(180.0F);
    rendermanager.setRenderShadow(false);
    rendermanager.renderEntityWithPosYaw(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
    rendermanager.setRenderShadow(true);
    ent.renderYawOffset = f;
    ent.rotationYaw = f1;
    ent.rotationPitch = f2;
    ent.prevRotationYawHead = f3;
    ent.rotationYawHead = f4;
    GlStateManager.popMatrix();
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.disableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:43,代码来源:GuiInventory.java

示例5: doRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
    this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    this.itemRenderer.renderItem(this.getStackToRender(entity), ItemCameraTransforms.TransformType.GROUND);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:32,代码来源:RenderSnowball.java

示例6: drawEntityOnScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws an entity on the screen looking toward the cursor.
 */
public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent)
{
    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)posX, (float)posY, 50.0F);
    GlStateManager.scale((float)(-scale), (float)scale, (float)scale);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    float f = ent.renderYawOffset;
    float f1 = ent.rotationYaw;
    float f2 = ent.rotationPitch;
    float f3 = ent.prevRotationYawHead;
    float f4 = ent.rotationYawHead;
    GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
    ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F;
    ent.rotationYaw = (float)Math.atan((double)(mouseX / 40.0F)) * 40.0F;
    ent.rotationPitch = -((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F;
    ent.rotationYawHead = ent.rotationYaw;
    ent.prevRotationYawHead = ent.rotationYaw;
    GlStateManager.translate(0.0F, 0.0F, 0.0F);
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    rendermanager.setPlayerViewY(180.0F);
    rendermanager.setRenderShadow(false);
    rendermanager.doRenderEntity(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
    rendermanager.setRenderShadow(true);
    ent.renderYawOffset = f;
    ent.rotationYaw = f1;
    ent.rotationPitch = f2;
    ent.prevRotationYawHead = f3;
    ent.rotationYawHead = f4;
    GlStateManager.popMatrix();
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.disableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:43,代码来源:GuiInventory.java

示例7: doRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(T entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    this.bindEntityTexture(entity);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.pushMatrix();
    GlStateManager.disableLighting();
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.rotate(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks - 90.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks, 0.0F, 0.0F, 1.0F);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    int i = 0;
    float f = 0.0F;
    float f1 = 0.5F;
    float f2 = 0.0F;
    float f3 = 0.15625F;
    float f4 = 0.0F;
    float f5 = 0.15625F;
    float f6 = 0.15625F;
    float f7 = 0.3125F;
    float f8 = 0.05625F;
    GlStateManager.enableRescaleNormal();
    float f9 = (float)entity.arrowShake - partialTicks;

    if (f9 > 0.0F)
    {
        float f10 = -MathHelper.sin(f9 * 3.0F) * f9;
        GlStateManager.rotate(f10, 0.0F, 0.0F, 1.0F);
    }

    GlStateManager.rotate(45.0F, 1.0F, 0.0F, 0.0F);
    GlStateManager.scale(0.05625F, 0.05625F, 0.05625F);
    GlStateManager.translate(-4.0F, 0.0F, 0.0F);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    GlStateManager.glNormal3f(0.05625F, 0.0F, 0.0F);
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos(-7.0D, -2.0D, -2.0D).tex(0.0D, 0.15625D).endVertex();
    vertexbuffer.pos(-7.0D, -2.0D, 2.0D).tex(0.15625D, 0.15625D).endVertex();
    vertexbuffer.pos(-7.0D, 2.0D, 2.0D).tex(0.15625D, 0.3125D).endVertex();
    vertexbuffer.pos(-7.0D, 2.0D, -2.0D).tex(0.0D, 0.3125D).endVertex();
    tessellator.draw();
    GlStateManager.glNormal3f(-0.05625F, 0.0F, 0.0F);
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos(-7.0D, 2.0D, -2.0D).tex(0.0D, 0.15625D).endVertex();
    vertexbuffer.pos(-7.0D, 2.0D, 2.0D).tex(0.15625D, 0.15625D).endVertex();
    vertexbuffer.pos(-7.0D, -2.0D, 2.0D).tex(0.15625D, 0.3125D).endVertex();
    vertexbuffer.pos(-7.0D, -2.0D, -2.0D).tex(0.0D, 0.3125D).endVertex();
    tessellator.draw();

    for (int j = 0; j < 4; ++j)
    {
        GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
        GlStateManager.glNormal3f(0.0F, 0.0F, 0.05625F);
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
        vertexbuffer.pos(-8.0D, -2.0D, 0.0D).tex(0.0D, 0.0D).endVertex();
        vertexbuffer.pos(8.0D, -2.0D, 0.0D).tex(0.5D, 0.0D).endVertex();
        vertexbuffer.pos(8.0D, 2.0D, 0.0D).tex(0.5D, 0.15625D).endVertex();
        vertexbuffer.pos(-8.0D, 2.0D, 0.0D).tex(0.0D, 0.15625D).endVertex();
        tessellator.draw();
    }

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.disableRescaleNormal();
    GlStateManager.enableLighting();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:82,代码来源:RenderArrow.java

示例8: doRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityThrown entity, double x, double y, double z, float entityYaw, float partialTicks)
{
	if(entity.isLocation())
	{
		GlStateManager.pushMatrix();
        GlStateManager.translate((float)x, (float)y, (float)z);
        GlStateManager.disableLighting();
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f);
        this.bindEntityTexture(entity);
        int i = entity.getLocation().getId();
        if(i == 1)
        	GlStateManager.depthFunc(519);
        float f = (float)(i % 4 * 16 + 0) / 64.0F;
        float f1 = (float)(i % 4 * 16 + 16) / 64.0F;
        float f2 = (float)(i / 4 * 16 + 0) / 64.0F;
        float f3 = (float)(i / 4 * 16 + 16) / 64.0F;
        GlStateManager.translate(0.0F, -0.1F, 0.0F);
        GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        float f7 = 0.3F;
        GlStateManager.scale(0.3F, 0.3F, 0.3F);
        GlStateManager.translate(0.1F, 0.0F, 0.0F);
        Tessellator tessellator = Tessellator.getInstance();
        BufferBuilder bufferbuilder = tessellator.getBuffer();
        bufferbuilder.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
        if (this.renderOutlines)
        {
            GlStateManager.enableColorMaterial();
            GlStateManager.enableOutlineMode(this.getTeamColor(entity));
        }
        bufferbuilder.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
        bufferbuilder.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
        bufferbuilder.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
        bufferbuilder.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).color(255, 255, 255, 255).normal(0.0F, 1.0F, 0.0F).endVertex();
        tessellator.draw();
        GlStateManager.disableRescaleNormal();
    	GlStateManager.depthFunc(515);
        GlStateManager.enableLighting();
        GlStateManager.popMatrix();
        super.doRender(entity, x, y, z, entityYaw, partialTicks);
	}
	else
	{
		GlStateManager.pushMatrix();
        GlStateManager.translate((float)x, (float)y, (float)z);
        GlStateManager.enableRescaleNormal();
        GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
        this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
        
        if (this.renderOutlines)
        {
            GlStateManager.enableColorMaterial();
            GlStateManager.enableOutlineMode(this.getTeamColor(entity));
        }
        
        Minecraft.getMinecraft().getRenderItem().renderItem(entity.getStack(), ItemCameraTransforms.TransformType.GROUND);

        if (this.renderOutlines)
        {
            GlStateManager.disableOutlineMode();
            GlStateManager.disableColorMaterial();
        }

        GlStateManager.disableRescaleNormal();
        GlStateManager.popMatrix();
	}
}
 
开发者ID:kenijey,项目名称:harshencastle,代码行数:73,代码来源:RenderEntityThrown.java

示例9: drawScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws the screen and all the components in it.
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    super.drawScreen(mouseX, mouseY, partialTicks);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int i = (this.width - this.xSize) / 2;
        int j = (this.height - this.ySize) / 2;
        int k = this.selectedMerchantRecipe;
        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);
        ItemStack itemstack = merchantrecipe.getItemToBuy();
        ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
        ItemStack itemstack2 = merchantrecipe.getItemToSell();
        GlStateManager.pushMatrix();
        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.itemRender.zLevel = 100.0F;
        this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24);

        if (itemstack1 != null)
        {
            this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24);
            this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24);
        }

        this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24);
        this.itemRender.zLevel = 0.0F;
        GlStateManager.disableLighting();

        if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && itemstack != null)
        {
            this.renderToolTip(itemstack, mouseX, mouseY);
        }
        else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && itemstack1 != null)
        {
            this.renderToolTip(itemstack1, mouseX, mouseY);
        }
        else if (itemstack2 != null && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && itemstack2 != null)
        {
            this.renderToolTip(itemstack2, mouseX, mouseY);
        }
        else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY)))
        {
            this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY);
        }

        GlStateManager.popMatrix();
        GlStateManager.enableLighting();
        GlStateManager.enableDepth();
        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:62,代码来源:GuiMerchant.java

示例10: updateAchievementWindow

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void updateAchievementWindow()
{
    if (this.theAchievement != null && this.notificationTime != 0L && Minecraft.getMinecraft().thePlayer != null)
    {
        double d0 = (double)(Minecraft.getSystemTime() - this.notificationTime) / 3000.0D;

        if (!this.permanentNotification)
        {
            if (d0 < 0.0D || d0 > 1.0D)
            {
                this.notificationTime = 0L;
                return;
            }
        }
        else if (d0 > 0.5D)
        {
            d0 = 0.5D;
        }

        this.updateAchievementWindowScale();
        GlStateManager.disableDepth();
        GlStateManager.depthMask(false);
        double d1 = d0 * 2.0D;

        if (d1 > 1.0D)
        {
            d1 = 2.0D - d1;
        }

        d1 = d1 * 4.0D;
        d1 = 1.0D - d1;

        if (d1 < 0.0D)
        {
            d1 = 0.0D;
        }

        d1 = d1 * d1;
        d1 = d1 * d1;
        int i = this.width - 160;
        int j = 0 - (int)(d1 * 36.0D);
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        GlStateManager.enableTexture2D();
        this.mc.getTextureManager().bindTexture(achievementBg);
        GlStateManager.disableLighting();
        this.drawTexturedModalRect(i, j, 96, 202, 160, 32);

        if (this.permanentNotification)
        {
            this.mc.fontRendererObj.drawSplitString(this.achievementDescription, i + 30, j + 7, 120, -1);
        }
        else
        {
            this.mc.fontRendererObj.drawString(this.achievementTitle, i + 30, j + 7, -256);
            this.mc.fontRendererObj.drawString(this.achievementDescription, i + 30, j + 18, -1);
        }

        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.renderItem.renderItemAndEffectIntoGUI(this.theAchievement.theItemStack, i + 8, j + 8);
        GlStateManager.disableLighting();
        GlStateManager.depthMask(true);
        GlStateManager.enableDepth();
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:69,代码来源:GuiAchievement.java

示例11: doRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityFireball entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.bindEntityTexture(entity);
    GlStateManager.translate((float)x, (float)y, (float)z);
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(this.scale, this.scale, this.scale);
    TextureAtlasSprite textureatlassprite = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getParticleIcon(Items.FIRE_CHARGE);
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    float f = textureatlassprite.getMinU();
    float f1 = textureatlassprite.getMaxU();
    float f2 = textureatlassprite.getMinV();
    float f3 = textureatlassprite.getMaxV();
    float f4 = 1.0F;
    float f5 = 0.5F;
    float f6 = 0.25F;
    GlStateManager.rotate(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate((float)(this.renderManager.options.thirdPersonView == 2 ? -1 : 1) * -this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_NORMAL);
    vertexbuffer.pos(-0.5D, -0.25D, 0.0D).tex((double)f, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, -0.25D, 0.0D).tex((double)f1, (double)f3).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(0.5D, 0.75D, 0.0D).tex((double)f1, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    vertexbuffer.pos(-0.5D, 0.75D, 0.0D).tex((double)f, (double)f2).normal(0.0F, 1.0F, 0.0F).endVertex();
    tessellator.draw();

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:47,代码来源:RenderFireball.java

示例12: doRender

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityItemFrame entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    BlockPos blockpos = entity.getHangingPosition();
    double d0 = (double)blockpos.getX() - entity.posX + x;
    double d1 = (double)blockpos.getY() - entity.posY + y;
    double d2 = (double)blockpos.getZ() - entity.posZ + z;
    GlStateManager.translate(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D);
    GlStateManager.rotate(180.0F - entity.rotationYaw, 0.0F, 1.0F, 0.0F);
    this.renderManager.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    BlockRendererDispatcher blockrendererdispatcher = this.mc.getBlockRendererDispatcher();
    ModelManager modelmanager = blockrendererdispatcher.getBlockModelShapes().getModelManager();
    IBakedModel ibakedmodel;

    if (entity.getDisplayedItem() != null && entity.getDisplayedItem().getItem() == Items.FILLED_MAP)
    {
        ibakedmodel = modelmanager.getModel(this.mapModel);
    }
    else
    {
        ibakedmodel = modelmanager.getModel(this.itemFrameModel);
    }

    GlStateManager.pushMatrix();
    GlStateManager.translate(-0.5F, -0.5F, -0.5F);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    blockrendererdispatcher.getBlockModelRenderer().renderModelBrightnessColor(ibakedmodel, 1.0F, 1.0F, 1.0F, 1.0F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    GlStateManager.translate(0.0F, 0.0F, 0.4375F);
    this.renderItem(entity);
    GlStateManager.popMatrix();
    this.renderName(entity, x + (double)((float)entity.facingDirection.getFrontOffsetX() * 0.3F), y - 0.25D, z + (double)((float)entity.facingDirection.getFrontOffsetZ() * 0.3F));
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:50,代码来源:RenderItemFrame.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:Notoh,项目名称:DecompiledMinecraft,代码行数:44,代码来源:Framebuffer.java

示例14: drawScreen

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
 * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
 */
public void drawScreen(int mouseX, int mouseY, float partialTicks)
{
    super.drawScreen(mouseX, mouseY, partialTicks);
    MerchantRecipeList merchantrecipelist = this.merchant.getRecipes(this.mc.thePlayer);

    if (merchantrecipelist != null && !merchantrecipelist.isEmpty())
    {
        int i = (this.width - this.xSize) / 2;
        int j = (this.height - this.ySize) / 2;
        int k = this.selectedMerchantRecipe;
        MerchantRecipe merchantrecipe = (MerchantRecipe)merchantrecipelist.get(k);
        ItemStack itemstack = merchantrecipe.getItemToBuy();
        ItemStack itemstack1 = merchantrecipe.getSecondItemToBuy();
        ItemStack itemstack2 = merchantrecipe.getItemToSell();
        GlStateManager.pushMatrix();
        RenderHelper.enableGUIStandardItemLighting();
        GlStateManager.disableLighting();
        GlStateManager.enableRescaleNormal();
        GlStateManager.enableColorMaterial();
        GlStateManager.enableLighting();
        this.itemRender.zLevel = 100.0F;
        this.itemRender.renderItemAndEffectIntoGUI(itemstack, i + 36, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack, i + 36, j + 24);

        if (itemstack1 != null)
        {
            this.itemRender.renderItemAndEffectIntoGUI(itemstack1, i + 62, j + 24);
            this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack1, i + 62, j + 24);
        }

        this.itemRender.renderItemAndEffectIntoGUI(itemstack2, i + 120, j + 24);
        this.itemRender.renderItemOverlays(this.fontRendererObj, itemstack2, i + 120, j + 24);
        this.itemRender.zLevel = 0.0F;
        GlStateManager.disableLighting();

        if (this.isPointInRegion(36, 24, 16, 16, mouseX, mouseY) && itemstack != null)
        {
            this.renderToolTip(itemstack, mouseX, mouseY);
        }
        else if (itemstack1 != null && this.isPointInRegion(62, 24, 16, 16, mouseX, mouseY) && itemstack1 != null)
        {
            this.renderToolTip(itemstack1, mouseX, mouseY);
        }
        else if (itemstack2 != null && this.isPointInRegion(120, 24, 16, 16, mouseX, mouseY) && itemstack2 != null)
        {
            this.renderToolTip(itemstack2, mouseX, mouseY);
        }
        else if (merchantrecipe.isRecipeDisabled() && (this.isPointInRegion(83, 21, 28, 21, mouseX, mouseY) || this.isPointInRegion(83, 51, 28, 21, mouseX, mouseY)))
        {
            this.drawCreativeTabHoveringText(I18n.format("merchant.deprecated", new Object[0]), mouseX, mouseY);
        }

        GlStateManager.popMatrix();
        GlStateManager.enableLighting();
        GlStateManager.enableDepth();
        RenderHelper.enableStandardItemLighting();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:62,代码来源:GuiMerchant.java

示例15: framebufferRenderExt

import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void framebufferRenderExt(int width, int height, 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)width, (double)height, 0.0D, 1000.0D, 3000.0D);
        GlStateManager.matrixMode(5888);
        GlStateManager.loadIdentity();
        GlStateManager.translate(0.0F, 0.0F, -2000.0F);
        GlStateManager.viewport(0, 0, width, height);
        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)width;
        float f1 = (float)height;
        float f2 = (float)this.framebufferWidth / (float)this.framebufferTextureWidth;
        float f3 = (float)this.framebufferHeight / (float)this.framebufferTextureHeight;
        Tessellator tessellator = Tessellator.getInstance();
        VertexBuffer vertexbuffer = tessellator.getBuffer();
        vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
        vertexbuffer.pos(0.0D, (double)f1, 0.0D).tex(0.0D, 0.0D).color(255, 255, 255, 255).endVertex();
        vertexbuffer.pos((double)f, (double)f1, 0.0D).tex((double)f2, 0.0D).color(255, 255, 255, 255).endVertex();
        vertexbuffer.pos((double)f, 0.0D, 0.0D).tex((double)f2, (double)f3).color(255, 255, 255, 255).endVertex();
        vertexbuffer.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:F1r3w477,项目名称:CustomWorldGen,代码行数:44,代码来源:Framebuffer.java


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