You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			90 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Java
		
	
			
		
		
	
	
			90 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Java
		
	
package net.minecraft.client.particle;
 | 
						|
 | 
						|
import cpw.mods.fml.relauncher.Side;
 | 
						|
import cpw.mods.fml.relauncher.SideOnly;
 | 
						|
import net.minecraft.client.renderer.Tessellator;
 | 
						|
import net.minecraft.world.World;
 | 
						|
 | 
						|
@SideOnly(Side.CLIENT)
 | 
						|
public class EntitySpellParticleFX extends EntityFX
 | 
						|
{
 | 
						|
    /** Base spell texture index */
 | 
						|
    private int baseSpellTextureIndex = 128;
 | 
						|
    private static final String __OBFID = "CL_00000926";
 | 
						|
 | 
						|
    public EntitySpellParticleFX(World p_i1229_1_, double p_i1229_2_, double p_i1229_4_, double p_i1229_6_, double p_i1229_8_, double p_i1229_10_, double p_i1229_12_)
 | 
						|
    {
 | 
						|
        super(p_i1229_1_, p_i1229_2_, p_i1229_4_, p_i1229_6_, p_i1229_8_, p_i1229_10_, p_i1229_12_);
 | 
						|
        this.motionY *= 0.20000000298023224D;
 | 
						|
 | 
						|
        if (p_i1229_8_ == 0.0D && p_i1229_12_ == 0.0D)
 | 
						|
        {
 | 
						|
            this.motionX *= 0.10000000149011612D;
 | 
						|
            this.motionZ *= 0.10000000149011612D;
 | 
						|
        }
 | 
						|
 | 
						|
        this.particleScale *= 0.75F;
 | 
						|
        this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
 | 
						|
        this.noClip = false;
 | 
						|
    }
 | 
						|
 | 
						|
    public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, float p_70539_5_, float p_70539_6_, float p_70539_7_)
 | 
						|
    {
 | 
						|
        float f6 = ((float)this.particleAge + p_70539_2_) / (float)this.particleMaxAge * 32.0F;
 | 
						|
 | 
						|
        if (f6 < 0.0F)
 | 
						|
        {
 | 
						|
            f6 = 0.0F;
 | 
						|
        }
 | 
						|
 | 
						|
        if (f6 > 1.0F)
 | 
						|
        {
 | 
						|
            f6 = 1.0F;
 | 
						|
        }
 | 
						|
 | 
						|
        super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Called to update the entity's position/logic.
 | 
						|
     */
 | 
						|
    public void onUpdate()
 | 
						|
    {
 | 
						|
        this.prevPosX = this.posX;
 | 
						|
        this.prevPosY = this.posY;
 | 
						|
        this.prevPosZ = this.posZ;
 | 
						|
 | 
						|
        if (this.particleAge++ >= this.particleMaxAge)
 | 
						|
        {
 | 
						|
            this.setDead();
 | 
						|
        }
 | 
						|
 | 
						|
        this.setParticleTextureIndex(this.baseSpellTextureIndex + (7 - this.particleAge * 8 / this.particleMaxAge));
 | 
						|
        this.motionY += 0.004D;
 | 
						|
        this.moveEntity(this.motionX, this.motionY, this.motionZ);
 | 
						|
 | 
						|
        if (this.posY == this.prevPosY)
 | 
						|
        {
 | 
						|
            this.motionX *= 1.1D;
 | 
						|
            this.motionZ *= 1.1D;
 | 
						|
        }
 | 
						|
 | 
						|
        this.motionX *= 0.9599999785423279D;
 | 
						|
        this.motionY *= 0.9599999785423279D;
 | 
						|
        this.motionZ *= 0.9599999785423279D;
 | 
						|
 | 
						|
        if (this.onGround)
 | 
						|
        {
 | 
						|
            this.motionX *= 0.699999988079071D;
 | 
						|
            this.motionZ *= 0.699999988079071D;
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Sets the base spell texture index
 | 
						|
     */
 | 
						|
    public void setBaseSpellTextureIndex(int p_70589_1_)
 | 
						|
    {
 | 
						|
        this.baseSpellTextureIndex = p_70589_1_;
 | 
						|
    }
 | 
						|
} |