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