001    package net.minecraft.client.renderer.entity;
002    
003    import cpw.mods.fml.relauncher.Side;
004    import cpw.mods.fml.relauncher.SideOnly;
005    import java.util.Random;
006    import net.minecraft.block.Block;
007    import net.minecraft.client.Minecraft;
008    import net.minecraft.client.gui.FontRenderer;
009    import net.minecraft.client.renderer.ItemRenderer;
010    import net.minecraft.client.renderer.RenderBlocks;
011    import net.minecraft.client.renderer.RenderEngine;
012    import net.minecraft.client.renderer.Tessellator;
013    import net.minecraft.entity.Entity;
014    import net.minecraft.entity.item.EntityItem;
015    import net.minecraft.item.Item;
016    import net.minecraft.item.ItemBlock;
017    import net.minecraft.item.ItemStack;
018    import net.minecraft.util.MathHelper;
019    import org.lwjgl.opengl.GL11;
020    import org.lwjgl.opengl.GL12;
021    
022    import net.minecraftforge.client.ForgeHooksClient;
023    
024    @SideOnly(Side.CLIENT)
025    public class RenderItem extends Render
026    {
027        private RenderBlocks renderBlocks = new RenderBlocks();
028    
029        /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */
030        private Random random = new Random();
031        public boolean field_77024_a = true;
032    
033        /** Defines the zLevel of rendering of item on GUI. */
034        public float zLevel = 0.0F;
035        public static boolean field_82407_g = false;
036    
037        public RenderItem()
038        {
039            this.shadowSize = 0.15F;
040            this.shadowOpaque = 0.75F;
041        }
042    
043        /**
044         * Renders the item
045         */
046        public void doRenderItem(EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9)
047        {
048            this.random.setSeed(187L);
049            ItemStack var10 = par1EntityItem.func_92014_d();
050    
051            if (var10.getItem() != null)
052            {
053                GL11.glPushMatrix();
054                float var11 = MathHelper.sin(((float)par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F;
055                float var12 = (((float)par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI);
056                byte var13 = 1;
057    
058                if (par1EntityItem.func_92014_d().stackSize > 1)
059                {
060                    var13 = 2;
061                }
062    
063                if (par1EntityItem.func_92014_d().stackSize > 5)
064                {
065                    var13 = 3;
066                }
067    
068                if (par1EntityItem.func_92014_d().stackSize > 20)
069                {
070                    var13 = 4;
071                }
072    
073                if (par1EntityItem.func_92014_d().stackSize > 40)
074                {
075                    var13 = 5;
076                }
077    
078                GL11.glTranslatef((float)par2, (float)par4 + var11, (float)par6);
079                GL11.glEnable(GL12.GL_RESCALE_NORMAL);
080                int var16;
081                float var19;
082                float var20;
083                float var24;
084    
085                if (ForgeHooksClient.renderEntityItem(par1EntityItem, var10, var11, var12, random, renderManager.renderEngine, renderBlocks))
086                {
087                    ;
088                }
089                else if (var10.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[var10.itemID].getRenderType()))
090                {
091                    GL11.glRotatef(var12, 0.0F, 1.0F, 0.0F);
092    
093                    if (field_82407_g)
094                    {
095                        GL11.glScalef(1.25F, 1.25F, 1.25F);
096                        GL11.glTranslatef(0.0F, 0.05F, 0.0F);
097                        GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
098                    }
099    
100                    this.loadTexture(Block.blocksList[var10.itemID].getTextureFile());
101                    float var22 = 0.25F;
102                    var16 = Block.blocksList[var10.itemID].getRenderType();
103    
104                    if (var16 == 1 || var16 == 19 || var16 == 12 || var16 == 2)
105                    {
106                        var22 = 0.5F;
107                    }
108    
109                    GL11.glScalef(var22, var22, var22);
110    
111                    for (int var23 = 0; var23 < var13; ++var23)
112                    {
113                        GL11.glPushMatrix();
114    
115                        if (var23 > 0)
116                        {
117                            var24 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var22;
118                            var19 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var22;
119                            var20 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / var22;
120                            GL11.glTranslatef(var24, var19, var20);
121                        }
122    
123                        var24 = 1.0F;
124                        this.renderBlocks.renderBlockAsItem(Block.blocksList[var10.itemID], var10.getItemDamage(), var24);
125                        GL11.glPopMatrix();
126                    }
127                }
128                else
129                {
130                    int var15;
131                    float var17;
132    
133                    if (var10.getItem().requiresMultipleRenderPasses())
134                    {
135                        if (field_82407_g)
136                        {
137                            GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
138                            GL11.glTranslatef(0.0F, -0.05F, 0.0F);
139                        }
140                        else
141                        {
142                            GL11.glScalef(0.5F, 0.5F, 0.5F);
143                        }
144    
145                        this.loadTexture(Item.itemsList[var10.itemID].getTextureFile());
146                        
147                        for (var15 = 0; var15 <= var10.getItem().getRenderPasses(var10.getItemDamage()); ++var15)
148                        {
149                            this.random.setSeed(187L);
150                            var16 = var10.getItem().getIconIndex(var10, var15);
151                            var17 = 1.0F;
152    
153                            if (this.field_77024_a)
154                            {
155                                int var18 = Item.itemsList[var10.itemID].getColorFromItemStack(var10, var15);
156                                var19 = (float)(var18 >> 16 & 255) / 255.0F;
157                                var20 = (float)(var18 >> 8 & 255) / 255.0F;
158                                float var21 = (float)(var18 & 255) / 255.0F;
159                                GL11.glColor4f(var19 * var17, var20 * var17, var21 * var17, 1.0F);
160                                this.func_77020_a(par1EntityItem, var16, var13, par9, var19 * var17, var20 * var17, var21 * var17);
161                            }
162                            else
163                            {
164                                this.func_77020_a(par1EntityItem, var16, var13, par9, 1.0F, 1.0F, 1.0F);
165                            }
166                        }
167                    }
168                    else
169                    {
170                        if (field_82407_g)
171                        {
172                            GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F);
173                            GL11.glTranslatef(0.0F, -0.05F, 0.0F);
174                        }
175                        else
176                        {
177                            GL11.glScalef(0.5F, 0.5F, 0.5F);
178                        }
179    
180                        var15 = var10.getIconIndex();
181    
182                        this.loadTexture(var10.getItem().getTextureFile());
183    
184                        if (this.field_77024_a)
185                        {
186                            var16 = Item.itemsList[var10.itemID].getColorFromItemStack(var10, 0);
187                            var17 = (float)(var16 >> 16 & 255) / 255.0F;
188                            var24 = (float)(var16 >> 8 & 255) / 255.0F;
189                            var19 = (float)(var16 & 255) / 255.0F;
190                            var20 = 1.0F;
191                            this.func_77020_a(par1EntityItem, var15, var13, par9, var17 * var20, var24 * var20, var19 * var20);
192                        }
193                        else
194                        {
195                            this.func_77020_a(par1EntityItem, var15, var13, par9, 1.0F, 1.0F, 1.0F);
196                        }
197                    }
198                }
199    
200                GL11.glDisable(GL12.GL_RESCALE_NORMAL);
201                GL11.glPopMatrix();
202            }
203        }
204    
205        private void func_77020_a(EntityItem par1EntityItem, int par2, int par3, float par4, float par5, float par6, float par7)
206        {
207            Tessellator var8 = Tessellator.instance;
208            float var9 = (float)(par2 % 16 * 16 + 0) / 256.0F;
209            float var10 = (float)(par2 % 16 * 16 + 16) / 256.0F;
210            float var11 = (float)(par2 / 16 * 16 + 0) / 256.0F;
211            float var12 = (float)(par2 / 16 * 16 + 16) / 256.0F;
212            float var13 = 1.0F;
213            float var14 = 0.5F;
214            float var15 = 0.25F;
215            float var17;
216    
217            if (this.renderManager.options.fancyGraphics)
218            {
219                GL11.glPushMatrix();
220    
221                if (field_82407_g)
222                {
223                    GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
224                }
225                else
226                {
227                    GL11.glRotatef((((float)par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
228                }
229    
230                float var16 = 0.0625F;
231                var17 = 0.021875F;
232                ItemStack var18 = par1EntityItem.func_92014_d();
233                int var19 = var18.stackSize;
234                byte var24;
235    
236                if (var19 < 2)
237                {
238                    var24 = 1;
239                }
240                else if (var19 < 16)
241                {
242                    var24 = 2;
243                }
244                else if (var19 < 32)
245                {
246                    var24 = 3;
247                }
248                else
249                {
250                    var24 = 4;
251                }
252    
253                GL11.glTranslatef(-var14, -var15, -((var16 + var17) * (float)var24 / 2.0F));
254    
255                for (int var20 = 0; var20 < var24; ++var20)
256                {
257                    GL11.glTranslatef(0.0F, 0.0F, var16 + var17);
258    
259                    if (Block.blocksList[var18.itemID] != null)
260                    {
261                        this.loadTexture("/terrain.png");
262                    }
263                    else
264                    {
265                        this.loadTexture("/gui/items.png");
266                    }
267    
268                    GL11.glColor4f(par5, par6, par7, 1.0F);
269                    ItemRenderer.renderItemIn2D(var8, var10, var11, var9, var12, var16);
270    
271                    if (var18 != null && var18.hasEffect())
272                    {
273                        GL11.glDepthFunc(GL11.GL_EQUAL);
274                        GL11.glDisable(GL11.GL_LIGHTING);
275                        this.renderManager.renderEngine.bindTexture(this.renderManager.renderEngine.getTexture("%blur%/misc/glint.png"));
276                        GL11.glEnable(GL11.GL_BLEND);
277                        GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
278                        float var21 = 0.76F;
279                        GL11.glColor4f(0.5F * var21, 0.25F * var21, 0.8F * var21, 1.0F);
280                        GL11.glMatrixMode(GL11.GL_TEXTURE);
281                        GL11.glPushMatrix();
282                        float var22 = 0.125F;
283                        GL11.glScalef(var22, var22, var22);
284                        float var23 = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F;
285                        GL11.glTranslatef(var23, 0.0F, 0.0F);
286                        GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F);
287                        ItemRenderer.renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, var16);
288                        GL11.glPopMatrix();
289                        GL11.glPushMatrix();
290                        GL11.glScalef(var22, var22, var22);
291                        var23 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F;
292                        GL11.glTranslatef(-var23, 0.0F, 0.0F);
293                        GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F);
294                        ItemRenderer.renderItemIn2D(var8, 0.0F, 0.0F, 1.0F, 1.0F, 0.0625F);
295                        GL11.glPopMatrix();
296                        GL11.glMatrixMode(GL11.GL_MODELVIEW);
297                        GL11.glDisable(GL11.GL_BLEND);
298                        GL11.glEnable(GL11.GL_LIGHTING);
299                        GL11.glDepthFunc(GL11.GL_LEQUAL);
300                    }
301                }
302    
303                GL11.glPopMatrix();
304            }
305            else
306            {
307                for (int var25 = 0; var25 < par3; ++var25)
308                {
309                    GL11.glPushMatrix();
310    
311                    if (var25 > 0)
312                    {
313                        var17 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
314                        float var27 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
315                        float var26 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.3F;
316                        GL11.glTranslatef(var17, var27, var26);
317                    }
318    
319                    if (!field_82407_g)
320                    {
321                        GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
322                    }
323    
324                    GL11.glColor4f(par5, par6, par7, 1.0F);
325                    var8.startDrawingQuads();
326                    var8.setNormal(0.0F, 1.0F, 0.0F);
327                    var8.addVertexWithUV((double)(0.0F - var14), (double)(0.0F - var15), 0.0D, (double)var9, (double)var12);
328                    var8.addVertexWithUV((double)(var13 - var14), (double)(0.0F - var15), 0.0D, (double)var10, (double)var12);
329                    var8.addVertexWithUV((double)(var13 - var14), (double)(1.0F - var15), 0.0D, (double)var10, (double)var11);
330                    var8.addVertexWithUV((double)(0.0F - var14), (double)(1.0F - var15), 0.0D, (double)var9, (double)var11);
331                    var8.draw();
332                    GL11.glPopMatrix();
333                }
334            }
335        }
336    
337        /**
338         * Renders the item's icon or block into the UI at the specified position.
339         */
340        public void renderItemIntoGUI(FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
341        {
342            int var6 = par3ItemStack.itemID;
343            int var7 = par3ItemStack.getItemDamage();
344            int var8 = par3ItemStack.getIconIndex();
345            int var10;
346            float var12;
347            float var13;
348            float var16;
349    
350            if (par3ItemStack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[par3ItemStack.itemID].getRenderType()))
351            {
352                Block var15 = Block.blocksList[var6];
353                par2RenderEngine.bindTexture(par2RenderEngine.getTexture(var15.getTextureFile()));
354                GL11.glPushMatrix();
355                GL11.glTranslatef((float)(par4 - 2), (float)(par5 + 3), -3.0F + this.zLevel);
356                GL11.glScalef(10.0F, 10.0F, 10.0F);
357                GL11.glTranslatef(1.0F, 0.5F, 1.0F);
358                GL11.glScalef(1.0F, 1.0F, -1.0F);
359                GL11.glRotatef(210.0F, 1.0F, 0.0F, 0.0F);
360                GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
361                var10 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, 0);
362                var16 = (float)(var10 >> 16 & 255) / 255.0F;
363                var12 = (float)(var10 >> 8 & 255) / 255.0F;
364                var13 = (float)(var10 & 255) / 255.0F;
365    
366                if (this.field_77024_a)
367                {
368                    GL11.glColor4f(var16, var12, var13, 1.0F);
369                }
370    
371                GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
372                this.renderBlocks.useInventoryTint = this.field_77024_a;
373                this.renderBlocks.renderBlockAsItem(var15, var7, 1.0F);
374                this.renderBlocks.useInventoryTint = true;
375                GL11.glPopMatrix();
376            }
377            else
378            {
379                int var9;
380    
381                if (Item.itemsList[var6].requiresMultipleRenderPasses())
382                {
383                    GL11.glDisable(GL11.GL_LIGHTING);
384                    par2RenderEngine.bindTexture(par2RenderEngine.getTexture(Item.itemsList[var6].getTextureFile()));
385    
386                    for (var9 = 0; var9 < Item.itemsList[var6].getRenderPasses(var7); ++var9)
387                    {
388                        var10 = Item.itemsList[var6].getIconIndex(par3ItemStack, var9);
389                        int var11 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, var9);
390                        var12 = (float)(var11 >> 16 & 255) / 255.0F;
391                        var13 = (float)(var11 >> 8 & 255) / 255.0F;
392                        float var14 = (float)(var11 & 255) / 255.0F;
393    
394                        if (this.field_77024_a)
395                        {
396                            GL11.glColor4f(var12, var13, var14, 1.0F);
397                        }
398    
399                        this.renderTexturedQuad(par4, par5, var10 % 16 * 16, var10 / 16 * 16, 16, 16);
400                    }
401    
402                    GL11.glEnable(GL11.GL_LIGHTING);
403                }
404                else if (var8 >= 0)
405                {
406                    GL11.glDisable(GL11.GL_LIGHTING);
407    
408                    par2RenderEngine.bindTexture(par2RenderEngine.getTexture(par3ItemStack.getItem().getTextureFile()));
409    
410                    var9 = Item.itemsList[var6].getColorFromItemStack(par3ItemStack, 0);
411                    float var17 = (float)(var9 >> 16 & 255) / 255.0F;
412                    var16 = (float)(var9 >> 8 & 255) / 255.0F;
413                    var12 = (float)(var9 & 255) / 255.0F;
414    
415                    if (this.field_77024_a)
416                    {
417                        GL11.glColor4f(var17, var16, var12, 1.0F);
418                    }
419    
420                    this.renderTexturedQuad(par4, par5, var8 % 16 * 16, var8 / 16 * 16, 16, 16);
421                    GL11.glEnable(GL11.GL_LIGHTING);
422                }
423            }
424    
425            GL11.glEnable(GL11.GL_CULL_FACE);
426        }
427    
428        /**
429         * Render the item's icon or block into the GUI, including the glint effect.
430         */
431        public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
432        {
433            if (par3ItemStack != null)
434            {
435                if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, field_77024_a, zLevel, (float)par4, (float)par5))
436                {
437                    this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5);
438                }
439    
440                if (par3ItemStack != null && par3ItemStack.hasEffect())
441                {
442                    GL11.glDepthFunc(GL11.GL_GREATER);
443                    GL11.glDisable(GL11.GL_LIGHTING);
444                    GL11.glDepthMask(false);
445                    par2RenderEngine.bindTexture(par2RenderEngine.getTexture("%blur%/misc/glint.png"));
446                    this.zLevel -= 50.0F;
447                    GL11.glEnable(GL11.GL_BLEND);
448                    GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
449                    GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
450                    this.func_77018_a(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20);
451                    GL11.glDisable(GL11.GL_BLEND);
452                    GL11.glDepthMask(true);
453                    this.zLevel += 50.0F;
454                    GL11.glEnable(GL11.GL_LIGHTING);
455                    GL11.glDepthFunc(GL11.GL_LEQUAL);
456                }
457            }
458        }
459    
460        private void func_77018_a(int par1, int par2, int par3, int par4, int par5)
461        {
462            for (int var6 = 0; var6 < 2; ++var6)
463            {
464                if (var6 == 0)
465                {
466                    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
467                }
468    
469                if (var6 == 1)
470                {
471                    GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
472                }
473    
474                float var7 = 0.00390625F;
475                float var8 = 0.00390625F;
476                float var9 = (float)(Minecraft.getSystemTime() % (long)(3000 + var6 * 1873)) / (3000.0F + (float)(var6 * 1873)) * 256.0F;
477                float var10 = 0.0F;
478                Tessellator var11 = Tessellator.instance;
479                float var12 = 4.0F;
480    
481                if (var6 == 1)
482                {
483                    var12 = -1.0F;
484                }
485    
486                var11.startDrawingQuads();
487                var11.addVertexWithUV((double)(par2 + 0), (double)(par3 + par5), (double)this.zLevel, (double)((var9 + (float)par5 * var12) * var7), (double)((var10 + (float)par5) * var8));
488                var11.addVertexWithUV((double)(par2 + par4), (double)(par3 + par5), (double)this.zLevel, (double)((var9 + (float)par4 + (float)par5 * var12) * var7), (double)((var10 + (float)par5) * var8));
489                var11.addVertexWithUV((double)(par2 + par4), (double)(par3 + 0), (double)this.zLevel, (double)((var9 + (float)par4) * var7), (double)((var10 + 0.0F) * var8));
490                var11.addVertexWithUV((double)(par2 + 0), (double)(par3 + 0), (double)this.zLevel, (double)((var9 + 0.0F) * var7), (double)((var10 + 0.0F) * var8));
491                var11.draw();
492            }
493        }
494    
495        /**
496         * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the
497         * specified position.
498         */
499        public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5)
500        {
501            if (par3ItemStack != null)
502            {
503                if (par3ItemStack.stackSize > 1)
504                {
505                    String var6 = "" + par3ItemStack.stackSize;
506                    GL11.glDisable(GL11.GL_LIGHTING);
507                    GL11.glDisable(GL11.GL_DEPTH_TEST);
508                    par1FontRenderer.drawStringWithShadow(var6, par4 + 19 - 2 - par1FontRenderer.getStringWidth(var6), par5 + 6 + 3, 16777215);
509                    GL11.glEnable(GL11.GL_LIGHTING);
510                    GL11.glEnable(GL11.GL_DEPTH_TEST);
511                }
512    
513                if (par3ItemStack.isItemDamaged())
514                {
515                    int var11 = (int)Math.round(13.0D - (double)par3ItemStack.getItemDamageForDisplay() * 13.0D / (double)par3ItemStack.getMaxDamage());
516                    int var7 = (int)Math.round(255.0D - (double)par3ItemStack.getItemDamageForDisplay() * 255.0D / (double)par3ItemStack.getMaxDamage());
517                    GL11.glDisable(GL11.GL_LIGHTING);
518                    GL11.glDisable(GL11.GL_DEPTH_TEST);
519                    GL11.glDisable(GL11.GL_TEXTURE_2D);
520                    Tessellator var8 = Tessellator.instance;
521                    int var9 = 255 - var7 << 16 | var7 << 8;
522                    int var10 = (255 - var7) / 4 << 16 | 16128;
523                    this.renderQuad(var8, par4 + 2, par5 + 13, 13, 2, 0);
524                    this.renderQuad(var8, par4 + 2, par5 + 13, 12, 1, var10);
525                    this.renderQuad(var8, par4 + 2, par5 + 13, var11, 1, var9);
526                    GL11.glEnable(GL11.GL_TEXTURE_2D);
527                    GL11.glEnable(GL11.GL_LIGHTING);
528                    GL11.glEnable(GL11.GL_DEPTH_TEST);
529                    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
530                }
531            }
532        }
533    
534        /**
535         * Adds a quad to the tesselator at the specified position with the set width and height and color.  Args:
536         * tessellator, x, y, width, height, color
537         */
538        private void renderQuad(Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6)
539        {
540            par1Tessellator.startDrawingQuads();
541            par1Tessellator.setColorOpaque_I(par6);
542            par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + 0), 0.0D);
543            par1Tessellator.addVertex((double)(par2 + 0), (double)(par3 + par5), 0.0D);
544            par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + par5), 0.0D);
545            par1Tessellator.addVertex((double)(par2 + par4), (double)(par3 + 0), 0.0D);
546            par1Tessellator.draw();
547        }
548    
549        /**
550         * Adds a textured quad to the tesselator at the specified position with the specified texture coords, width and
551         * height.  Args: x, y, u, v, width, height
552         */
553        public void renderTexturedQuad(int par1, int par2, int par3, int par4, int par5, int par6)
554        {
555            float var7 = 0.00390625F;
556            float var8 = 0.00390625F;
557            Tessellator var9 = Tessellator.instance;
558            var9.startDrawingQuads();
559            var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + par6) * var8));
560            var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + par6), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + par6) * var8));
561            var9.addVertexWithUV((double)(par1 + par5), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + par5) * var7), (double)((float)(par4 + 0) * var8));
562            var9.addVertexWithUV((double)(par1 + 0), (double)(par2 + 0), (double)this.zLevel, (double)((float)(par3 + 0) * var7), (double)((float)(par4 + 0) * var8));
563            var9.draw();
564        }
565    
566        /**
567         * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
568         * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
569         * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
570         * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
571         */
572        public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
573        {
574            this.doRenderItem((EntityItem)par1Entity, par2, par4, par6, par8, par9);
575        }
576    }