use of pokefenn.totemic.client.gui.GuiLexiconEntry in project Totemic by TeamTotemic.
the class PageRecipe method renderItem.
@SideOnly(Side.CLIENT)
public void renderItem(IGuiLexiconEntry gui, int xPos, int yPos, ItemStack stack, boolean accountForContainer) {
RenderItem render = Minecraft.getMinecraft().getRenderItem();
boolean mouseDown = Mouse.isButtonDown(0);
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
net.minecraft.client.renderer.RenderHelper.enableGUIStandardItemLighting();
GlStateManager.enableRescaleNormal();
GlStateManager.enableDepth();
render.renderItemAndEffectIntoGUI(stack, xPos, yPos);
render.renderItemOverlayIntoGUI(Minecraft.getMinecraft().fontRenderer, stack, xPos, yPos, null);
net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
GlStateManager.popMatrix();
if (relativeMouseX >= xPos && relativeMouseY >= yPos && relativeMouseX <= xPos + 16 && relativeMouseY <= yPos + 16) {
tooltipStack = stack;
LexiconRecipeMappings.EntryData data = LexiconRecipeMappings.getDataForStack(tooltipStack);
if (data != null && (data.entry != gui.getEntry() || data.page != gui.getPageOn())) {
tooltipEntry = true;
if (!mouseDownLastTick && mouseDown && GuiScreen.isShiftKeyDown()) {
GuiLexiconEntry newGui = new GuiLexiconEntry(data.entry, (GuiScreen) gui);
newGui.page = data.page;
Minecraft.getMinecraft().displayGuiScreen(newGui);
}
}
if (accountForContainer) {
ItemStack containerStack = stack.getItem().getContainerItem(stack);
if (!containerStack.isEmpty())
tooltipContainerStack = containerStack;
}
}
}
Aggregations