    001package net.minecraft.client.gui;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import java.util.ArrayList;
    006import java.util.List;
    007import net.minecraft.client.Minecraft;
    008import org.lwjgl.opengl.GL11;
    009
    010@SideOnly(Side.CLIENT)
    011public 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 i = 0; i < this.particles.size(); ++i)
    024        {
    025            Particle particle = (Particle)this.particles.get(i);
    026            particle.preUpdate();
    027            particle.update(this);
    028
    029            if (particle.isDead)
    030            {
    031                this.particles.remove(i--);
    032            }
    033        }
    034    }
    035
    036    public void draw(float par1)
    037    {
    038        this.mc.renderEngine.bindTexture("/gui/particles.png");
    039
    040        for (int i = 0; i < this.particles.size(); ++i)
    041        {
    042            Particle particle = (Particle)this.particles.get(i);
    043            int j = (int)(particle.prevPosX + (particle.posX - particle.prevPosX) * (double)par1 - 4.0D);
    044            int k = (int)(particle.prevPosY + (particle.posY - particle.prevPosY) * (double)par1 - 4.0D);
    045            float f1 = (float)(particle.prevTintAlpha + (particle.tintAlpha - particle.prevTintAlpha) * (double)par1);
    046            float f2 = (float)(particle.prevTintRed + (particle.tintRed - particle.prevTintRed) * (double)par1);
    047            float f3 = (float)(particle.prevTintGreen + (particle.tintGreen - particle.prevTintGreen) * (double)par1);
    048            float f4 = (float)(particle.prevTintBlue + (particle.tintBlue - particle.prevTintBlue) * (double)par1);
    049            GL11.glColor4f(f2, f3, f4, f1);
    050            this.drawTexturedModalRect(j, k, 40, 0, 8, 8);
    051        }
    052    }
    053}