| 1 | package net.minecraft.client.particle;
|
| 2 |
|
| 3 | import net.minecraft.world.World;
|
| 4 |
|
| 5 | public class EntityFishWakeFX extends EntityFX
|
| 6 | {
|
| 7 | protected EntityFishWakeFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double p_i45073_8_, double p_i45073_10_, double p_i45073_12_)
|
| 8 | {
|
| 9 | super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
|
| 10 | this.motionX *= 0.30000001192092896D;
|
| 11 | this.motionY = Math.random() * 0.20000000298023224D + 0.10000000149011612D;
|
| 12 | this.motionZ *= 0.30000001192092896D;
|
| 13 | this.particleRed = 1.0F;
|
| 14 | this.particleGreen = 1.0F;
|
| 15 | this.particleBlue = 1.0F;
|
| 16 | this.setParticleTextureIndex(19);
|
| 17 | this.setSize(0.01F, 0.01F);
|
| 18 | this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
|
| 19 | this.particleGravity = 0.0F;
|
| 20 | this.motionX = p_i45073_8_;
|
| 21 | this.motionY = p_i45073_10_;
|
| 22 | this.motionZ = p_i45073_12_;
|
| 23 | }
|
| 24 |
|
| 25 | /**
|
| 26 | * Called to update the entity's position/logic.
|
| 27 | */
|
| 28 | public void onUpdate()
|
| 29 | {
|
| 30 | this.prevPosX = this.posX;
|
| 31 | this.prevPosY = this.posY;
|
| 32 | this.prevPosZ = this.posZ;
|
| 33 | this.motionY -= (double)this.particleGravity;
|
| 34 | this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
| 35 | this.motionX *= 0.9800000190734863D;
|
| 36 | this.motionY *= 0.9800000190734863D;
|
| 37 | this.motionZ *= 0.9800000190734863D;
|
| 38 | int i = 60 - this.particleMaxAge;
|
| 39 | float f = (float)i * 0.001F;
|
| 40 | this.setSize(f, f);
|
| 41 | this.setParticleTextureIndex(19 + i % 4);
|
| 42 |
|
| 43 | if (this.particleMaxAge-- <= 0)
|
| 44 | {
|
| 45 | this.setDead();
|
| 46 | }
|
| 47 | }
|
| 48 |
|
| 49 | public static class Factory implements IParticleFactory
|
| 50 | {
|
| 51 | public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
| 52 | {
|
| 53 | return new EntityFishWakeFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
|
| 54 | }
|
| 55 | }
|
| 56 | }
|
| 57 |
|