本文整理汇总了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();
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例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());
}
}
示例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();
}