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


Java TextureUtil.func_152777_a方法代码示例

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


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

示例1: renderSign

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderSign() {
	final IIcon iicon = Items.sign.getIconFromDamage(0);
	TextureUtil.func_152777_a(false, false, 1f);
	final float f = iicon.getMinU();
	final float f1 = iicon.getMaxU();
	final float f2 = iicon.getMinV();
	final float f3 = iicon.getMaxV();
	ItemRenderer.renderItemIn2D(WRenderer.t, f1, f2, f, f3, iicon.getIconWidth(), iicon.getIconHeight(), 0.0625f);
}
 
开发者ID:Team-Fruit,项目名称:SignPicture,代码行数:10,代码来源:CustomItemSignRenderer.java

示例2: renderFrontPlate

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void renderFrontPlate(EntityRobotVillager par1EntityVillager) {

        RobotVillagerProfession prof = RobotVillagerProfession.getProfession(par1EntityVillager.getProfession());
        if(prof == null) {

            // something weird happened
            return;
        }
        //
        GL11.glPushMatrix();
        //texturemanager.bindTexture(texturemanager.getResourceLocation(p_78443_2_.getItemSpriteNumber()));


        //this.bindTexture(new ResourceLocation(AmunRa.instance.ASSETPREFIX, "textures/entity/icons/refinery_front.png"));
        this.bindTexture(prof.getIcon());
        TextureUtil.func_152777_a(false, false, 1.0F);
        Tessellator tessellator = Tessellator.instance;

        float scale = 0.45F;

//        float f4 = -0.25F;

        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        GL11.glTranslatef(-scale/2, 0.10F, -0.20F);

        GL11.glScalef(scale, scale, scale);


        //////
        // p_78439_0_ is a tesselator
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 0.0F, 1.0F);

        tessellator.addVertexWithUV(0.0D, 0.0D, 0.0D, 0, 0);
        tessellator.addVertexWithUV(1.0D, 0.0D, 0.0D, 1, 0);
        tessellator.addVertexWithUV(1.0D, 1.0D, 0.0D, 1, 1);
        tessellator.addVertexWithUV(0.0D, 1.0D, 0.0D, 0, 1);
        tessellator.draw();
        /// and stuff
        GL11.glPopMatrix();
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        TextureUtil.func_147945_b();
    }
 
开发者ID:katzenpapst,项目名称:amunra,代码行数:44,代码来源:RenderRobotVillager.java

示例3: draw3DItem

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
private void draw3DItem(ItemStack is, float itemX, float itemZ)
{
	GL11.glPushMatrix();
	GL11.glTranslatef(itemX, 0.1F, itemZ);
	GL11.glRotatef(90, 1.0F, 0.0F, 0.0F);
	GL11.glRotatef(180, 0.0F, 0.0F, 1.0F);
	GL11.glScalef(0.25F, 0.25F, 1F);
	
	TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
   	bindTexture(texturemanager.getResourceLocation(is.getItemSpriteNumber()));
       TextureUtil.func_152777_a(false, false, 1.0F);
       GL11.glEnable(GL12.GL_RESCALE_NORMAL);

       IIcon icon = is.getIconIndex();

       int color = is.getItem().getColorFromItemStack(is, 0);
       float red = ((color & 0xFF0000)>>16)/255f;
       float green = ((color & 0x00ff00)>>8)/255f;
       float blue = (color & 0x0000ff)/255f;
       
       if(is.getItem() instanceof IFood && Food.isCooked(is))
	{
		color = Food.getCookedColorMultiplier(is);
		red = (((color & 0xFF0000)>>16)/255f) - 0.2F;
           green = (((color & 0x00ff00)>>8)/255f) - 0.2F;
           blue = ((color & 0x0000ff)/255f) - 0.2F;
	}

       bindTexture(TextureMap.locationItemsTexture);

       GL11.glColor4f(red, green, blue, 1.0F);
       
       ItemRenderer.renderItemIn2D(Tessellator.instance, icon.getMaxU(), icon.getMinV(), icon.getMinU(), icon.getMaxV(),
       		icon.getIconWidth(), icon.getIconHeight(), 0.0625F);
       
       GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

       GL11.glDisable(GL12.GL_RESCALE_NORMAL);
       bindTexture(texturemanager.getResourceLocation(is.getItemSpriteNumber()));
       TextureUtil.func_147945_b();
	
	GL11.glPopMatrix();
}
 
开发者ID:StrayWolfe,项目名称:Cooking-with-TFC,代码行数:44,代码来源:TESRClayOven.java

示例4: renderIconInPlayerHandWithColor

import net.minecraft.client.renderer.texture.TextureUtil; //导入方法依赖的package包/类
public static void renderIconInPlayerHandWithColor(IIcon icon, int itemSpriteNumber, int r, int g, int b, int a, boolean glint) {

        GL11.glPushMatrix();

        if (icon == null) {
            GL11.glPopMatrix();
            return;
        }


        getMinecraft().getTextureManager().bindTexture(getMinecraft().getTextureManager().
                getResourceLocation(itemSpriteNumber));
        TextureUtil.func_152777_a(false, false, 1.f);
        Tessellator tessellator = Tessellator.instance;
        float f4 = 0.0F;
        float f5 = 0.3F;
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);
        float f6 = 1.5F;
        renderIconIn2DWithColor(tessellator, icon, 0.0625f, false, r, g, b, a);

        if (glint) {
            GL11.glDepthFunc(GL11.GL_EQUAL);
            GL11.glDisable(GL11.GL_LIGHTING);
            getMinecraft().getTextureManager().bindTexture(GLINT);
            GL11.glEnable(GL11.GL_BLEND);
            OpenGlHelper.glBlendFunc(768, 1, 1, 0);
            float f7 = 0.76F;
            GL11.glColor4f(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F);
            GL11.glMatrixMode(GL11.GL_TEXTURE);
            GL11.glPushMatrix();
            float f8 = 0.125F;
            GL11.glScalef(f8, f8, f8);
            float f9 = (float) (getSystemTime() % 3000L) / 3000.0F * 8.0F;
            GL11.glTranslatef(f9, 0.0F, 0.0F);
            GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
            renderIconIn2DWithColor(tessellator, 0.0f, 0.0f, 1.0f, 1.0f, 256, 256, 0.0625f, r, g, b, a);
            GL11.glPopMatrix();
            GL11.glPushMatrix();
            GL11.glScalef(f8, f8, f8);
            f9 = (float) (getSystemTime() % 4873L) / 4873.0F * 8.0F;
            GL11.glTranslatef(-f9, 0.0F, 0.0F);
            GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
            renderIconIn2DWithColor(tessellator, 0.0f, 0.0f, 1.0f, 1.0f, 256, 256, 0.0625f, r, g, b, a);
            GL11.glPopMatrix();
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glDisable(GL11.GL_BLEND);
            GL11.glEnable(GL11.GL_LIGHTING);
            GL11.glDepthFunc(GL11.GL_LEQUAL);
        }

        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        getMinecraft().getTextureManager().bindTexture(getMinecraft().getTextureManager().
                getResourceLocation(itemSpriteNumber));
        TextureUtil.func_147945_b();

        GL11.glPopMatrix();
    }
 
开发者ID:meew0,项目名称:AdvancedPotions,代码行数:58,代码来源:RenderUtils.java


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