EntityExplodeFX .java

net.minecraft.client.particle.EntityExplodeFX (class, 54 lines): extends EntityFX. members: Factory, onUpdate. imports: World.

net.minecraft.client.particleclass54 linesclientextends EntityFX2.0 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 (3)

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

Full Source

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

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