32 lines
1.2 KiB
Java
32 lines
1.2 KiB
Java
package net.minecraft.client.particle;
|
|
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.multiplayer.ClientLevel;
|
|
import net.minecraft.core.particles.DustParticleOptions;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public class DustParticle extends DustParticleBase<DustParticleOptions> {
|
|
protected DustParticle(
|
|
ClientLevel level, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, DustParticleOptions options, SpriteSet sprites
|
|
) {
|
|
super(level, x, y, z, xSpeed, ySpeed, zSpeed, options, sprites);
|
|
float f = this.random.nextFloat() * 0.4F + 0.6F;
|
|
this.rCol = this.randomizeColor(options.getColor().x(), f);
|
|
this.gCol = this.randomizeColor(options.getColor().y(), f);
|
|
this.bCol = this.randomizeColor(options.getColor().z(), f);
|
|
}
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public static class Provider implements ParticleProvider<DustParticleOptions> {
|
|
private final SpriteSet sprites;
|
|
|
|
public Provider(SpriteSet sprites) {
|
|
this.sprites = sprites;
|
|
}
|
|
|
|
public Particle createParticle(DustParticleOptions type, ClientLevel level, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
|
|
return new DustParticle(level, x, y, z, xSpeed, ySpeed, zSpeed, type, this.sprites);
|
|
}
|
|
}
|
|
}
|