56 lines
1.8 KiB
Java
56 lines
1.8 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*/
|
|
package net.minecraft.client.particle;
|
|
|
|
import net.minecraft.client.multiplayer.ClientLevel;
|
|
import net.minecraft.client.particle.Particle;
|
|
import net.minecraft.client.particle.ParticleProvider;
|
|
import net.minecraft.client.particle.SingleQuadParticle;
|
|
import net.minecraft.client.particle.SpriteSet;
|
|
import net.minecraft.core.particles.SimpleParticleType;
|
|
import net.minecraft.util.RandomSource;
|
|
|
|
public class SculkChargePopParticle
|
|
extends SingleQuadParticle {
|
|
private final SpriteSet sprites;
|
|
|
|
private SculkChargePopParticle(ClientLevel level, double x, double y, double z, double xd, double yd, double zd, SpriteSet sprites) {
|
|
super(level, x, y, z, xd, yd, zd, sprites.first());
|
|
this.friction = 0.96f;
|
|
this.sprites = sprites;
|
|
this.scale(1.0f);
|
|
this.hasPhysics = false;
|
|
this.setSpriteFromAge(sprites);
|
|
}
|
|
|
|
@Override
|
|
public int getLightColor(float a) {
|
|
return 240;
|
|
}
|
|
|
|
@Override
|
|
public SingleQuadParticle.Layer getLayer() {
|
|
return SingleQuadParticle.Layer.TRANSLUCENT;
|
|
}
|
|
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
this.setSpriteFromAge(this.sprites);
|
|
}
|
|
|
|
public record Provider(SpriteSet sprite) implements ParticleProvider<SimpleParticleType>
|
|
{
|
|
@Override
|
|
public Particle createParticle(SimpleParticleType options, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random) {
|
|
SculkChargePopParticle particle = new SculkChargePopParticle(level, x, y, z, xAux, yAux, zAux, this.sprite);
|
|
particle.setAlpha(1.0f);
|
|
particle.setParticleSpeed(xAux, yAux, zAux);
|
|
particle.setLifetime(random.nextInt(4) + 6);
|
|
return particle;
|
|
}
|
|
}
|
|
}
|
|
|