2025-11-24 22:52:51 +03:00

58 lines
1.9 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.SculkChargeParticleOptions;
import net.minecraft.util.RandomSource;
public class SculkChargeParticle
extends SingleQuadParticle {
private final SpriteSet sprites;
private SculkChargeParticle(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.5f);
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<SculkChargeParticleOptions>
{
@Override
public Particle createParticle(SculkChargeParticleOptions options, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random) {
SculkChargeParticle particle = new SculkChargeParticle(level, x, y, z, xAux, yAux, zAux, this.sprite);
particle.setAlpha(1.0f);
particle.setParticleSpeed(xAux, yAux, zAux);
particle.oRoll = options.roll();
particle.roll = options.roll();
particle.setLifetime(random.nextInt(12) + 8);
return particle;
}
}
}