/// <summary> /// Renders the item's icon or block into the UI at the specified position. /// </summary> public virtual void RenderItemIntoGUI(FontRenderer par1FontRenderer, RenderEngineOld par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) { if (par3ItemStack == null) { return; } DrawItemIntoGui(par1FontRenderer, par2RenderEngine, par3ItemStack.ItemID, par3ItemStack.GetItemDamage(), par3ItemStack.GetIconIndex(), par4, par5); if (par3ItemStack != null && par3ItemStack.HasEffect()) { //GL.DepthFunc(DepthFunction.Greater); //GL.Disable(EnableCap.Lighting); //GL.DepthMask(false); par2RenderEngine.BindTexture(par2RenderEngine.GetTexture("%blur%/misc/glint.png")); ZLevel -= 50F; //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.DstColor, BlendingFactorDest.DstColor); //GL.Color4(0.5F, 0.25F, 0.8F, 1.0F); Func_40266_a(par4 * 0x19b4ca14 + par5 * 0x1eafff1, par4 - 2, par5 - 2, 20, 20); //GL.Disable(EnableCap.Blend); //GL.DepthMask(true); ZLevel += 50F; //GL.Enable(EnableCap.Lighting); //GL.DepthFunc(DepthFunction.Lequal); } }
/// <summary> /// Renders the item stack for being in an entity's hand Args: itemStack /// </summary> public virtual void RenderItem(EntityLiving par1EntityLiving, ItemStack par2ItemStack, int par3) { //GL.PushMatrix(); if (par2ItemStack.ItemID < 256 && RenderBlocks.RenderItemIn3d(Block.BlocksList[par2ItemStack.ItemID].GetRenderType())) { //GL.BindTexture(TextureTarget.Texture2D, Mc.RenderEngineOld.GetTexture("/terrain.png")); RenderBlocksInstance.RenderBlockAsItem(Block.BlocksList[par2ItemStack.ItemID], par2ItemStack.GetItemDamage(), 1.0F); } else { if (par2ItemStack.ItemID < 256) { //GL.BindTexture(TextureTarget.Texture2D, Mc.RenderEngineOld.GetTexture("/terrain.png")); } else { //GL.BindTexture(TextureTarget.Texture2D, Mc.RenderEngineOld.GetTexture("/gui/items.png")); } Tessellator tessellator = Tessellator.Instance; int i = par1EntityLiving.GetItemIcon(par2ItemStack, par3); float f = ((float)((i % 16) * 16) + 0.0F) / 256F; float f1 = ((float)((i % 16) * 16) + 15.99F) / 256F; float f2 = ((float)((i / 16) * 16) + 0.0F) / 256F; float f3 = ((float)((i / 16) * 16) + 15.99F) / 256F; // float f4 = 0.0F; // float f5 = 0.3F; //GL.Enable(EnableCap.RescaleNormal); //GL.Translate(-f4, -f5, 0.0F); // float f6 = 1.5F; //GL.Scale(f6, f6, f6); //GL.Rotate(50F, 0.0F, 1.0F, 0.0F); //GL.Rotate(335F, 0.0F, 0.0F, 1.0F); //GL.Translate(-0.9375F, -0.0625F, 0.0F); RenderItemIn2D(tessellator, f1, f2, f, f3); if (par2ItemStack != null && par2ItemStack.HasEffect() && par3 == 0) { //GL.DepthFunc(DepthFunction.Equal); //GL.Disable(EnableCap.Lighting); Mc.RenderEngineOld.BindTexture(Mc.RenderEngineOld.GetTexture("%blur%/misc/glint.png")); //GL.Enable(EnableCap.Blend); //GL.BlendFunc(BlendingFactorSrc.One, BlendingFactorDest.One); // float f7 = 0.76F; //GL.Color4(0.5F * f7, 0.25F * f7, 0.8F * f7, 1.0F); //GL.MatrixMode(MatrixMode.Texture); //GL.PushMatrix(); // float f8 = 0.125F; //GL.Scale(f8, f8, f8); float f9 = ((float)(JavaHelper.CurrentTimeMillis() % 3000L) / 3000F) * 8F; //GL.Translate(f9, 0.0F, 0.0F); //GL.Rotate(-50F, 0.0F, 0.0F, 1.0F); RenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F); //GL.PopMatrix(); //GL.PushMatrix(); //GL.Scale(f8, f8, f8); f9 = ((float)(JavaHelper.CurrentTimeMillis() % 4873L) / 4873F) * 8F; //GL.Translate(-f9, 0.0F, 0.0F); //GL.Rotate(10F, 0.0F, 0.0F, 1.0F); RenderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F); //GL.PopMatrix(); //GL.MatrixMode(MatrixMode.Modelview); //GL.Disable(EnableCap.Blend); //GL.Enable(EnableCap.Lighting); //GL.DepthFunc(DepthFunction.Lequal); } //GL.Disable(EnableCap.RescaleNormal); } //GL.PopMatrix(); }