EntitySuspendFX .java

net.minecraft.client.particle.EntitySuspendFX (class, 53 lines): extends EntityFX. members: Factory, onUpdate. imports: Material.

net.minecraft.client.particleclass53 linesclientextends EntityFX1.8 KB

API Surface (2)

void onUpdate()
EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

EntitySuspendFX.java53 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.particle;
2
3
import net.minecraft.block.material.Material;
4
import net.minecraft.util.BlockPos;
5
import net.minecraft.world.World;
6
7
public class EntitySuspendFX extends EntityFX
8
{
9
    protected EntitySuspendFX(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn)
10
    {
11
        super(worldIn, xCoordIn, yCoordIn - 0.125D, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
12
        this.particleRed = 0.4F;
13
        this.particleGreen = 0.4F;
14
        this.particleBlue = 0.7F;
15
        this.setParticleTextureIndex(0);
16
        this.setSize(0.01F, 0.01F);
17
        this.particleScale *= this.rand.nextFloat() * 0.6F + 0.2F;
18
        this.motionX = xSpeedIn * 0.0D;
19
        this.motionY = ySpeedIn * 0.0D;
20
        this.motionZ = zSpeedIn * 0.0D;
21
        this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D));
22
    }
23
24
    /**
25
     * Called to update the entity's position/logic.
26
     */
27
    public void onUpdate()
28
    {
29
        this.prevPosX = this.posX;
30
        this.prevPosY = this.posY;
31
        this.prevPosZ = this.posZ;
32
        this.moveEntity(this.motionX, this.motionY, this.motionZ);
33
34
        if (this.worldObj.getBlockState(new BlockPos(this)).getBlock().getMaterial() != Material.water)
35
        {
36
            this.setDead();
37
        }
38
39
        if (this.particleMaxAge-- <= 0)
40
        {
41
            this.setDead();
42
        }
43
    }
44
45
    public static class Factory implements IParticleFactory
46
    {
47
        public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
48
        {
49
            return new EntitySuspendFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn);
50
        }
51
    }
52
}
53

Deobfuscated MCP 1.8.9 source of EntitySuspendFX from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/particle/EntitySuspendFX.java), stored verbatim.