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