    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import org.lwjgl.opengl.GL11;
    006    import org.lwjgl.opengl.GL12;
    007
    008    @SideOnly(Side.CLIENT)
    009    public class RenderArrow extends Render
    010    {
    011        public void renderArrow(EntityArrow par1EntityArrow, double par2, double par4, double par6, float par8, float par9)
    012        {
    013            this.loadTexture("/item/arrows.png");
    014            GL11.glPushMatrix();
    015            GL11.glTranslatef((float)par2, (float)par4, (float)par6);
    016            GL11.glRotatef(par1EntityArrow.prevRotationYaw + (par1EntityArrow.rotationYaw - par1EntityArrow.prevRotationYaw) * par9 - 90.0F, 0.0F, 1.0F, 0.0F);
    017            GL11.glRotatef(par1EntityArrow.prevRotationPitch + (par1EntityArrow.rotationPitch - par1EntityArrow.prevRotationPitch) * par9, 0.0F, 0.0F, 1.0F);
    018            Tessellator var10 = Tessellator.instance;
    019            byte var11 = 0;
    020            float var12 = 0.0F;
    021            float var13 = 0.5F;
    022            float var14 = (float)(0 + var11 * 10) / 32.0F;
    023            float var15 = (float)(5 + var11 * 10) / 32.0F;
    024            float var16 = 0.0F;
    025            float var17 = 0.15625F;
    026            float var18 = (float)(5 + var11 * 10) / 32.0F;
    027            float var19 = (float)(10 + var11 * 10) / 32.0F;
    028            float var20 = 0.05625F;
    029            GL11.glEnable(GL12.GL_RESCALE_NORMAL);
    030            float var21 = (float)par1EntityArrow.arrowShake - par9;
    031
    032            if (var21 > 0.0F)
    033            {
    034                float var22 = -MathHelper.sin(var21 * 3.0F) * var21;
    035                GL11.glRotatef(var22, 0.0F, 0.0F, 1.0F);
    036            }
    037
    038            GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F);
    039            GL11.glScalef(var20, var20, var20);
    040            GL11.glTranslatef(-4.0F, 0.0F, 0.0F);
    041            GL11.glNormal3f(var20, 0.0F, 0.0F);
    042            var10.startDrawingQuads();
    043            var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var18);
    044            var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var18);
    045            var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var19);
    046            var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var19);
    047            var10.draw();
    048            GL11.glNormal3f(-var20, 0.0F, 0.0F);
    049            var10.startDrawingQuads();
    050            var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var18);
    051            var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var18);
    052            var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var19);
    053            var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19);
    054            var10.draw();
    055
    056            for (int var23 = 0; var23 < 4; ++var23)
    057            {
    058                GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
    059                GL11.glNormal3f(0.0F, 0.0F, var20);
    060                var10.startDrawingQuads();
    061                var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)var12, (double)var14);
    062                var10.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)var13, (double)var14);
    063                var10.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)var13, (double)var15);
    064                var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)var12, (double)var15);
    065                var10.draw();
    066            }
    067
    068            GL11.glDisable(GL12.GL_RESCALE_NORMAL);
    069            GL11.glPopMatrix();
    070        }
    071
    072        /**
    073         * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
    074         * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
    075         * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
    076         * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
    077         */
    078        public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
    079        {
    080            this.renderArrow((EntityArrow)par1Entity, par2, par4, par6, par8, par9);
    081        }
    082    }