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.
		
		
		
		
		
			
		
			
				
	
	
		
			88 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			Java
		
	
			
		
		
	
	
			88 lines
		
	
	
		
			3.0 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.util.MathHelper;
 | 
						|
import net.minecraft.world.World;
 | 
						|
 | 
						|
@SideOnly(Side.CLIENT)
 | 
						|
public class EntityNoteFX extends EntityFX
 | 
						|
{
 | 
						|
    float noteParticleScale;
 | 
						|
    private static final String __OBFID = "CL_00000913";
 | 
						|
 | 
						|
    public EntityNoteFX(World p_i1216_1_, double p_i1216_2_, double p_i1216_4_, double p_i1216_6_, double p_i1216_8_, double p_i1216_10_, double p_i1216_12_)
 | 
						|
    {
 | 
						|
        this(p_i1216_1_, p_i1216_2_, p_i1216_4_, p_i1216_6_, p_i1216_8_, p_i1216_10_, p_i1216_12_, 2.0F);
 | 
						|
    }
 | 
						|
 | 
						|
    public EntityNoteFX(World p_i1217_1_, double p_i1217_2_, double p_i1217_4_, double p_i1217_6_, double p_i1217_8_, double p_i1217_10_, double p_i1217_12_, float p_i1217_14_)
 | 
						|
    {
 | 
						|
        super(p_i1217_1_, p_i1217_2_, p_i1217_4_, p_i1217_6_, 0.0D, 0.0D, 0.0D);
 | 
						|
        this.motionX *= 0.009999999776482582D;
 | 
						|
        this.motionY *= 0.009999999776482582D;
 | 
						|
        this.motionZ *= 0.009999999776482582D;
 | 
						|
        this.motionY += 0.2D;
 | 
						|
        this.particleRed = MathHelper.sin(((float)p_i1217_8_ + 0.0F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F;
 | 
						|
        this.particleGreen = MathHelper.sin(((float)p_i1217_8_ + 0.33333334F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F;
 | 
						|
        this.particleBlue = MathHelper.sin(((float)p_i1217_8_ + 0.6666667F) * (float)Math.PI * 2.0F) * 0.65F + 0.35F;
 | 
						|
        this.particleScale *= 0.75F;
 | 
						|
        this.particleScale *= p_i1217_14_;
 | 
						|
        this.noteParticleScale = this.particleScale;
 | 
						|
        this.particleMaxAge = 6;
 | 
						|
        this.noClip = false;
 | 
						|
        this.setParticleTextureIndex(64);
 | 
						|
    }
 | 
						|
 | 
						|
    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;
 | 
						|
        }
 | 
						|
 | 
						|
        this.particleScale = this.noteParticleScale * f6;
 | 
						|
        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.moveEntity(this.motionX, this.motionY, this.motionZ);
 | 
						|
 | 
						|
        if (this.posY == this.prevPosY)
 | 
						|
        {
 | 
						|
            this.motionX *= 1.1D;
 | 
						|
            this.motionZ *= 1.1D;
 | 
						|
        }
 | 
						|
 | 
						|
        this.motionX *= 0.6600000262260437D;
 | 
						|
        this.motionY *= 0.6600000262260437D;
 | 
						|
        this.motionZ *= 0.6600000262260437D;
 | 
						|
 | 
						|
        if (this.onGround)
 | 
						|
        {
 | 
						|
            this.motionX *= 0.699999988079071D;
 | 
						|
            this.motionZ *= 0.699999988079071D;
 | 
						|
        }
 | 
						|
    }
 | 
						|
} |