    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import java.util.ArrayList;
    006    import java.util.Iterator;
    007    import java.util.List;
    008    import net.minecraft.client.Minecraft;
    009    import org.lwjgl.opengl.GL11;
    010
    011    @SideOnly(Side.CLIENT)
    012    public class GuiParticle extends Gui
    013    {
    014        private List particles = new ArrayList();
    015        private Minecraft mc;
    016
    017        public GuiParticle(Minecraft par1Minecraft)
    018        {
    019            this.mc = par1Minecraft;
    020        }
    021
    022        public void update()
    023        {
    024            for (int var1 = 0; var1 < this.particles.size(); ++var1)
    025            {
    026                Particle var2 = (Particle)this.particles.get(var1);
    027                var2.preUpdate();
    028                var2.update(this);
    029
    030                if (var2.isDead)
    031                {
    032                    this.particles.remove(var1--);
    033                }
    034            }
    035        }
    036
    037        public void draw(float par1)
    038        {
    039            this.mc.renderEngine.bindTexture(this.mc.renderEngine.getTexture("/gui/particles.png"));
    040            Iterator var2 = this.particles.iterator();
    041
    042            while (var2.hasNext())
    043            {
    044                Particle var3 = (Particle)var2.next();
    045                int var4 = (int)(var3.prevPosX + (var3.posX - var3.prevPosX) * (double)par1 - 4.0D);
    046                int var5 = (int)(var3.prevPosY + (var3.posY - var3.prevPosY) * (double)par1 - 4.0D);
    047                float var6 = (float)(var3.prevTintAlpha + (var3.tintAlpha - var3.prevTintAlpha) * (double)par1);
    048                float var7 = (float)(var3.prevTintRed + (var3.tintRed - var3.prevTintRed) * (double)par1);
    049                float var8 = (float)(var3.prevTintGreen + (var3.tintGreen - var3.prevTintGreen) * (double)par1);
    050                float var9 = (float)(var3.prevTintBlue + (var3.tintBlue - var3.prevTintBlue) * (double)par1);
    051                GL11.glColor4f(var7, var8, var9, var6);
    052                this.drawTexturedModalRect(var4, var5, 40, 0, 8, 8);
    053            }
    054        }
    055    }