48 lines
No EOL
1.6 KiB
Java
48 lines
No EOL
1.6 KiB
Java
package com.atsuishio.superbwarfare.client.particle;
|
|
|
|
import net.minecraft.client.multiplayer.ClientLevel;
|
|
import net.minecraft.client.particle.*;
|
|
import net.minecraft.core.particles.SimpleParticleType;
|
|
import net.minecraftforge.api.distmarker.Dist;
|
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
|
|
|
@OnlyIn(Dist.CLIENT)
|
|
public class BulletHoleParticle extends TextureSheetParticle {
|
|
public static BulletholeParticleProvider provider(SpriteSet spriteSet) {
|
|
return new BulletholeParticleProvider(spriteSet);
|
|
}
|
|
|
|
public static class BulletholeParticleProvider implements ParticleProvider<SimpleParticleType> {
|
|
private final SpriteSet spriteSet;
|
|
|
|
public BulletholeParticleProvider(SpriteSet spriteSet) {
|
|
this.spriteSet = spriteSet;
|
|
}
|
|
|
|
public Particle createParticle(SimpleParticleType typeIn, ClientLevel worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed) {
|
|
return new BulletHoleParticle(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet);
|
|
}
|
|
}
|
|
|
|
protected BulletHoleParticle(ClientLevel world, double x, double y, double z, double vx, double vy, double vz, SpriteSet spriteSet) {
|
|
super(world, x, y, z);
|
|
this.setSize(0f, 0f);
|
|
this.lifetime = 100;
|
|
this.gravity = 0f;
|
|
this.hasPhysics = false;
|
|
this.xd = vx * 0;
|
|
this.yd = vy * 0;
|
|
this.zd = vz * 0;
|
|
this.pickSprite(spriteSet);
|
|
}
|
|
|
|
@Override
|
|
public ParticleRenderType getRenderType() {
|
|
return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT;
|
|
}
|
|
|
|
@Override
|
|
public void tick() {
|
|
super.tick();
|
|
}
|
|
} |