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 RenderFireball extends Render
010 {
011 private float field_77002_a;
012
013 public RenderFireball(float par1)
014 {
015 this.field_77002_a = par1;
016 }
017
018 public void doRenderFireball(EntityFireball par1EntityFireball, double par2, double par4, double par6, float par8, float par9)
019 {
020 GL11.glPushMatrix();
021 GL11.glTranslatef((float)par2, (float)par4, (float)par6);
022 GL11.glEnable(GL12.GL_RESCALE_NORMAL);
023 float var10 = this.field_77002_a;
024 GL11.glScalef(var10 / 1.0F, var10 / 1.0F, var10 / 1.0F);
025 byte var11 = 46;
026 this.loadTexture("/gui/items.png");
027 Tessellator var12 = Tessellator.instance;
028 float var13 = (float)(var11 % 16 * 16 + 0) / 256.0F;
029 float var14 = (float)(var11 % 16 * 16 + 16) / 256.0F;
030 float var15 = (float)(var11 / 16 * 16 + 0) / 256.0F;
031 float var16 = (float)(var11 / 16 * 16 + 16) / 256.0F;
032 float var17 = 1.0F;
033 float var18 = 0.5F;
034 float var19 = 0.25F;
035 GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
036 GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
037 var12.startDrawingQuads();
038 var12.setNormal(0.0F, 1.0F, 0.0F);
039 var12.addVertexWithUV((double)(0.0F - var18), (double)(0.0F - var19), 0.0D, (double)var13, (double)var16);
040 var12.addVertexWithUV((double)(var17 - var18), (double)(0.0F - var19), 0.0D, (double)var14, (double)var16);
041 var12.addVertexWithUV((double)(var17 - var18), (double)(1.0F - var19), 0.0D, (double)var14, (double)var15);
042 var12.addVertexWithUV((double)(0.0F - var18), (double)(1.0F - var19), 0.0D, (double)var13, (double)var15);
043 var12.draw();
044 GL11.glDisable(GL12.GL_RESCALE_NORMAL);
045 GL11.glPopMatrix();
046 }
047
048 /**
049 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
050 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
051 * (Render<T extends Entity) and this method has signature public void doRender(T entity, double d, double d1,
052 * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
053 */
054 public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)
055 {
056 this.doRenderFireball((EntityFireball)par1Entity, par2, par4, par6, par8, par9);
057 }
058 }