2026-05-04 12:09:37 +02:00
|
|
|
package com.vinlanx.explosionoverhaul.client;
|
|
|
|
|
|
|
|
|
|
import com.vinlanx.explosionoverhaul.SmokeParticleOptions;
|
|
|
|
|
import net.minecraft.client.multiplayer.ClientLevel;
|
|
|
|
|
import net.minecraft.client.particle.Particle;
|
|
|
|
|
import net.minecraft.client.particle.ParticleProvider;
|
|
|
|
|
import net.minecraft.client.particle.ParticleRenderType;
|
|
|
|
|
import net.minecraft.client.particle.SpriteSet;
|
|
|
|
|
import net.minecraft.client.particle.TextureSheetParticle;
|
|
|
|
|
|
2026-05-07 01:07:27 +02:00
|
|
|
public class SmokeParticle extends TextureSheetParticle {
|
|
|
|
|
protected SmokeParticle(ClientLevel level, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, SmokeParticleOptions options, SpriteSet sprites) {
|
|
|
|
|
super(level, x, y, z, xSpeed, ySpeed, zSpeed);
|
|
|
|
|
this.lifetime = 1;
|
|
|
|
|
this.pickSprite(sprites);
|
2026-05-04 12:09:37 +02:00
|
|
|
}
|
|
|
|
|
|
2026-05-07 01:07:27 +02:00
|
|
|
@Override
|
|
|
|
|
public ParticleRenderType getRenderType() {
|
|
|
|
|
return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
|
2026-05-04 12:09:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean shouldCull() {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-07 01:07:27 +02:00
|
|
|
public static class Provider implements ParticleProvider<SmokeParticleOptions> {
|
2026-05-04 12:09:37 +02:00
|
|
|
private final SpriteSet sprites;
|
|
|
|
|
|
2026-05-07 01:07:27 +02:00
|
|
|
public Provider(SpriteSet sprites) {
|
|
|
|
|
this.sprites = sprites;
|
2026-05-04 12:09:37 +02:00
|
|
|
}
|
|
|
|
|
|
2026-05-07 01:07:27 +02:00
|
|
|
@Override
|
|
|
|
|
public Particle createParticle(SmokeParticleOptions options, ClientLevel level, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
|
|
|
|
|
return new SmokeParticle(level, x, y, z, xSpeed, ySpeed, zSpeed, options, this.sprites);
|
2026-05-04 12:09:37 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|