File size: 2,086 Bytes
d46f4a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package net.minecraft.client.particle;

import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.particles.SimpleParticleType;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;

@OnlyIn(Dist.CLIENT)
public class SculkChargePopParticle extends TextureSheetParticle {
    private final SpriteSet sprites;

    SculkChargePopParticle(
        ClientLevel p_233932_, double p_233933_, double p_233934_, double p_233935_, double p_233936_, double p_233937_, double p_233938_, SpriteSet p_233939_
    ) {
        super(p_233932_, p_233933_, p_233934_, p_233935_, p_233936_, p_233937_, p_233938_);
        this.friction = 0.96F;
        this.sprites = p_233939_;
        this.scale(1.0F);
        this.hasPhysics = false;
        this.setSpriteFromAge(p_233939_);
    }

    @Override
    public int getLightColor(float p_233942_) {
        return 240;
    }

    @Override
    public ParticleRenderType getRenderType() {
        return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
    }

    @Override
    public void tick() {
        super.tick();
        this.setSpriteFromAge(this.sprites);
    }

    @OnlyIn(Dist.CLIENT)
    public static record Provider(SpriteSet sprite) implements ParticleProvider<SimpleParticleType> {
        public Particle createParticle(
            SimpleParticleType p_233958_,
            ClientLevel p_233959_,
            double p_233960_,
            double p_233961_,
            double p_233962_,
            double p_233963_,
            double p_233964_,
            double p_233965_
        ) {
            SculkChargePopParticle sculkchargepopparticle = new SculkChargePopParticle(
                p_233959_, p_233960_, p_233961_, p_233962_, p_233963_, p_233964_, p_233965_, this.sprite
            );
            sculkchargepopparticle.setAlpha(1.0F);
            sculkchargepopparticle.setParticleSpeed(p_233963_, p_233964_, p_233965_);
            sculkchargepopparticle.setLifetime(p_233959_.random.nextInt(4) + 6);
            return sculkchargepopparticle;
        }
    }
}