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


Java RenderItem.renderItemAndEffectIntoGUI方法代码示例

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


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

示例1: renderSlots

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
private void renderSlots(GearSwapperTE gearSwapperTE) {
    RenderHelper.enableGUIStandardItemLighting();

    float factor = 2.0f;
    float f3 = 0.0075F;
    GL11.glTranslatef(-0.5F, 0.5F, 0.04F);
    GL11.glScalef(f3 * factor, -f3 * factor, 0.0001f);

    RenderItem itemRender = Minecraft.getMinecraft().getRenderItem();

    for (int i = 0 ; i < 4 ; i++) {
        ItemStack stack = gearSwapperTE.getStackInSlot(i);
        if (stack != null) {
            itemRender.renderItemAndEffectIntoGUI(stack, xx[i], yy[i]);
        }
    }

    RenderHelper.enableStandardItemLighting();
}
 
开发者ID:McJty,项目名称:GearSwapper1.8,代码行数:20,代码来源:GearSwapperTESR.java

示例2: updateItemStackFocus

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
/** Redraws the ItemStack into the focus slot **/
private void updateItemStackFocus(ItemStack itemstack)
{
    if(itemstack != null)
    {
        RenderItem renderer = new RenderItem();
        
        GL11.glDisable(GL12.GL_RESCALE_NORMAL);
        
           RenderHelper.disableStandardItemLighting();
           GL11.glDisable(GL11.GL_LIGHTING);
           
           RenderHelper.enableGUIStandardItemLighting();
           GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
           GL11.glEnable(GL12.GL_RESCALE_NORMAL);       
           
           GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
           OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240 / 1.0F, 240 / 1.0F);  
           
       renderer.renderItemAndEffectIntoGUI(this.fontRenderer, this.renderEngine, itemstack, this.posX + 152, this.posY + 111);
    }       
}
 
开发者ID:ElConquistador,项目名称:WikiLink,代码行数:23,代码来源:GuiContainerMenu.java

示例3: draw

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
@Override
public void draw() 
{
	RenderItem renderer = new RenderItem();
	
	 GL11.glDisable(GL12.GL_RESCALE_NORMAL);
	 
        RenderHelper.disableStandardItemLighting();
        GL11.glDisable(GL11.GL_LIGHTING);
        
        RenderHelper.enableGUIStandardItemLighting();
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glEnable(GL12.GL_RESCALE_NORMAL);       
        
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240 / 1.0F, 240 / 1.0F);
        
	renderer.renderItemAndEffectIntoGUI(fontrenderer, renderengine, item, posX, posY);
}
 
开发者ID:ElConquistador,项目名称:WikiLink,代码行数:20,代码来源:WidgetFakeItem.java

示例4: renderItemStackInGUI

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
public static void renderItemStackInGUI(ItemStack itemStack, FontRenderer fontRendererObj, RenderItem itemRender, int x, int y, float zLevel) {
	if (itemStack == null)
		return;

	TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();

	RenderHelper.enableGUIStandardItemLighting();
	glDisable(GL_LIGHTING);
	glEnable(GL_RESCALE_NORMAL);
	glEnable(GL_COLOR_MATERIAL);
	glEnable(GL_LIGHTING);

	itemRender.zLevel = zLevel;

	itemRender.renderItemAndEffectIntoGUI(fontRendererObj, textureManager, itemStack, x, y);
	itemRender.renderItemOverlayIntoGUI(fontRendererObj, textureManager, itemStack, x, y);

	itemRender.zLevel = 0.0F;

	glDisable(GL_LIGHTING);
	glEnable(GL_LIGHTING);
	glEnable(GL_DEPTH_TEST);
}
 
开发者ID:NPException,项目名称:Dimensional-Pockets,代码行数:24,代码来源:RenderUtils.java

示例5: drawContents

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
protected void drawContents(RenderState renderState, float partialTicks) {
	renderState.enableTexture();
	renderState.enableDepthTest();
	renderState.enableCullFace();
	renderState.disableLight();
	renderState.setColor(0xFFFFFF, 1.0f);

	GL11.glScalef(scale, scale, scale);
	final RenderItem renderItem = getRenderItem();
	final Minecraft minecraft = Minecraft.getMinecraft();
	final TextureManager textureManager = minecraft.getTextureManager();

	renderItem.renderItemAndEffectIntoGUI(minecraft.fontRenderer, textureManager, drawStack, 0, 0);

	if (damageBar > 0 || !Strings.isNullOrEmpty(label)) {
		renderItem.renderItemOverlayIntoGUI(minecraft.fontRenderer, textureManager, dummyStack, 0, 0, label);
	}

	RenderUtils.disableLightmap();

	renderState.readState();
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral-Addons,代码行数:25,代码来源:ItemIcon.java

示例6: renderItem

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
private void renderItem(ItemStack stack, int x, int y) {
	RenderItem itemRender = new RenderItem();
	try {
		itemRender.renderItemAndEffectIntoGUI(gui.getFontRendererObj(), RenderUtils.textureManager(), stack, x, y);
	} catch (Throwable e) {
		try {
			itemRender.renderItemIntoGUI(gui.getFontRendererObj(), RenderUtils.textureManager(), stack, x, y);
		} catch (Throwable e2) {
			Logger.error("Failed to render item for category " + category.getName());
		}
	}
	GL11.glDisable(GL11.GL_LIGHTING);
	GL11.glEnable(GL11.GL_ALPHA_TEST);
}
 
开发者ID:AEnterprise,项目名称:Eureka,代码行数:15,代码来源:WidgetCategory.java

示例7: renderItem

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
private void renderItem(ItemStack stack, int x, int y) {
	RenderItem itemRender = new RenderItem();
	try {
		itemRender.renderItemAndEffectIntoGUI(gui.getFontRendererObj(), RenderUtils.textureManager(), stack, x, y);
	} catch (Throwable e) {
		try {
			itemRender.renderItemIntoGUI(gui.getFontRendererObj(), RenderUtils.textureManager(), stack, x, y);
		} catch (Throwable e2) {
			Logger.error("Failed to render item for chapter " + chapter.getName());
		}
	}
	GL11.glDisable(GL11.GL_LIGHTING);
	GL11.glEnable(GL11.GL_ALPHA_TEST);
}
 
开发者ID:AEnterprise,项目名称:Eureka,代码行数:15,代码来源:WidgetChapter.java

示例8: renderItemAndOverlay

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
public void renderItemAndOverlay(RenderItem render, FontRenderer f, TextureManager tex, ItemStack stack, int x, int y, boolean tooltip) {
    RenderHelper.disableStandardItemLighting();
    render.renderItemAndEffectIntoGUI(f, tex, stack, x, y);
    render.renderItemOverlayIntoGUI(f, tex, stack, x, y);

    if (tooltip && mx >= x && mx <= x+16 && my >= y && my <=y+16) {
        this.tooltip(stack.getTooltip(player, true), mx, my);
    }
}
 
开发者ID:MSourceCoded,项目名称:Quantum-Anomalies,代码行数:10,代码来源:GuiDiscoveryPage.java

示例9: drawGuiContainerBackgroundLayer

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float var1, int var2, int var3) {
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
       this.mc.getTextureManager().bindTexture(shieldGuiTexture);
       this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, this.xSize, this.ySize);
       if (shield.getPowerLevel() > 0) {
       	this.drawTexturedModalRect(guiLeft + 47, guiTop + 60, 0, 166, 16, 16);
       }
       
       RenderItem renderitem = new RenderItem();
       GL11.glEnable(GL12.GL_RESCALE_NORMAL);
       GL11.glEnable(GL11.GL_COLOR_MATERIAL);
       GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.6F);
       renderitem.renderWithColor = false;
       GL11.glEnable(GL11.GL_LIGHTING);
       GL11.glEnable(GL11.GL_CULL_FACE);
       
       if (shield.getPowerLevel() == 0) {
       	renderitem.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), new ItemStack(MeteorItems.itemMeteorChips), guiLeft + 47, guiTop + 60);
       }
       
       for (int i = 0; i < 4; ++i) {
       	renderitem.renderItemAndEffectIntoGUI(this.mc.fontRenderer, this.mc.getTextureManager(), new ItemStack(MeteorItems.itemRedMeteorGem), guiLeft + 67 + i * 29, guiTop + 60);
       }
       
       GL11.glDisable(GL11.GL_LIGHTING);
}
 
开发者ID:AlexDGr8r,项目名称:MeteorsMod,代码行数:28,代码来源:GuiMeteorShield.java

示例10: renderInventorySlot

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
/**
 * Renders the specified item of the inventory slot at the specified
 * location.
 */
public static void renderInventorySlot(int slot, int x, int y, float partialTick, Minecraft mc) {
    RenderItem itemRenderer = new RenderItem();
    ItemStack itemstack = mc.thePlayer.inventory.mainInventory[slot];
    x += 91;
    y += 12;

    if (itemstack != null) {
        float f1 = itemstack.animationsToGo - partialTick;

        if (f1 > 0.0F) {
            GL11.glPushMatrix();
            float f2 = 1.0F + f1 / 5.0F;
            GL11.glTranslatef(x + 8, y + 12, 0.0F);
            GL11.glScalef(1.0F / f2, (f2 + 1.0F) / 2.0F, 1.0F);
            GL11.glTranslatef(-(x + 8), -(y + 12), 0.0F);
        }

        itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), itemstack, x, y);

        if (f1 > 0.0F) {
            GL11.glPopMatrix();
        }

        itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.getTextureManager(), itemstack, x, y);
    }
}
 
开发者ID:maxpowa,项目名称:AdvancedHUD,代码行数:31,代码来源:RenderAssist.java

示例11: renderInjection

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
public void renderInjection() {
    int centreW = super.width / 2;
    int centreH = super.height / 2;

    RenderItem render = new RenderItem();

    float scale = 0.5F;
    float scaleI = (float) Math.pow(scale, -1);

    GL11.glTranslatef(centreW, centreH - 65, 0);
    GL11.glScalef(scale, scale, scale);
    drawCenteredStringWOShadow(fontRendererObj, EnumChatFormatting.ITALIC + LocalizationUtils.escapeFormatting(QABlocks.RIFT_INJECTION_POOL.getBlock().getLocalizedName()), 0, 0, Colourizer.BLACK.toInteger());
    GL11.glScalef(scaleI, scaleI, scaleI);
    GL11.glTranslatef(-centreW, -centreH + 65, 0);

    this.mc.getTextureManager().bindTexture(pageLocation);
    GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
    GL11.glColor4f(1F, 1F, 1F, 0.2F);
    drawPartialQuadWithBounds(centreW - 26, centreH - 40, 14, 10, 28 / 256F, 222 / 256F, 39 / 256F, 230 / 256F);
    drawPartialQuadWithBounds(centreW + 11, centreH - 40, 14, 10, 28 / 256F, 222 / 256F, 39 / 256F, 230 / 256F);

    render.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), new ItemStack(QABlocks.RIFT_INJECTION_POOL.getBlock()), centreW - 8, centreH - 44);

    IInjectorRecipe recipe = (IInjectorRecipe) currentPage.recipe;

    DecimalFormat format = new DecimalFormat("#,##0");

    if (recipe != null) {
        GL11.glTranslatef(centreW, centreH - 25, 0);
        GL11.glScalef(scale, scale, scale);
        drawCenteredStringWOShadow(fontRendererObj, format.format(recipe.getEnergyRequired()) + " QRE", 0, 0, Colourizer.BLACK.toInteger());
        drawCenteredStringWOShadow(fontRendererObj, "Tier: " + recipe.getTier(), 0, 13, Colourizer.BLACK.toInteger());
        GL11.glScalef(scaleI, scaleI, scaleI);
        GL11.glTranslatef(-centreW, -centreH + 25, 0);

        renderItemAndOverlay(render, fontRendererObj, mc.getTextureManager(), recipe.getInput(), centreW - 44, centreH - 44, true);
        renderItemAndOverlay(render, fontRendererObj, mc.getTextureManager(), recipe.getOutput(), centreW + 28, centreH - 44, true);

        renderCraftingContext(recipe.getContext());
    }

}
 
开发者ID:MSourceCoded,项目名称:Quantum-Anomalies,代码行数:43,代码来源:GuiDiscoveryPage.java

示例12: renderItem

import net.minecraft.client.renderer.entity.RenderItem; //导入方法依赖的package包/类
private void renderItem(Minecraft mc, RenderItem itemRenderer, ItemStack itemstack) {
	itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, itemstack, 0, 0); // mc.displayHeight-textureHeight
	// With empty string, because we don't want to have any text here
	itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, itemstack, 0, 0, ""); // mc.displayHeight-textureHeight
	checkGL();
}
 
开发者ID:RS485,项目名称:ItemRenderer,代码行数:7,代码来源:RenderClass.java


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