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

67 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.SimpleParticleType;
import net.minecraft.util.RandomSource;
public class AttackSweepParticle
extends SingleQuadParticle {
private final SpriteSet sprites;
private AttackSweepParticle(ClientLevel level, double x, double y, double z, double size, SpriteSet sprites) {
super(level, x, y, z, 0.0, 0.0, 0.0, sprites.first());
float col;
this.sprites = sprites;
this.lifetime = 4;
this.rCol = col = this.random.nextFloat() * 0.6f + 0.4f;
this.gCol = col;
this.bCol = col;
this.quadSize = 1.0f - (float)size * 0.5f;
this.setSpriteFromAge(sprites);
}
@Override
public int getLightColor(float a) {
return 0xF000F0;
}
@Override
public void tick() {
this.xo = this.x;
this.yo = this.y;
this.zo = this.z;
if (this.age++ >= this.lifetime) {
this.remove();
return;
}
this.setSpriteFromAge(this.sprites);
}
@Override
public SingleQuadParticle.Layer getLayer() {
return SingleQuadParticle.Layer.OPAQUE;
}
public static class Provider
implements ParticleProvider<SimpleParticleType> {
private final SpriteSet sprites;
public Provider(SpriteSet sprites) {
this.sprites = sprites;
}
@Override
public Particle createParticle(SimpleParticleType options, ClientLevel level, double x, double y, double z, double xAux, double yAux, double zAux, RandomSource random) {
return new AttackSweepParticle(level, x, y, z, xAux, this.sprites);
}
}
}