Files
ForkWar/LobbySystem/src/de/steamwar/lobby/particle/elements/SimpleParticle.java
T
YoyoNow 3366a30b0c Add BauSystem module
Fix ci java version
Fix LinkageProcessor
2024-08-05 13:28:50 +02:00

67 lines
2.0 KiB
Java

package de.steamwar.lobby.particle.elements;
import de.steamwar.lobby.particle.ParticleElement;
import de.steamwar.lobby.particle.ParticleTickData;
import org.bukkit.Location;
import org.bukkit.Particle;
public class SimpleParticle implements ParticleElement {
private final Particle particle;
private boolean customVelocity = false;
private float vx;
private float vy;
private float vz;
private double time = 1;
private int count = 5;
public SimpleParticle(Particle particle) {
this.particle = particle;
}
public SimpleParticle(Particle particle, float vx, float vy, float vz) {
this.particle = particle;
this.customVelocity = true;
this.vx = vx;
this.vy = vy;
this.vz = vz;
}
public SimpleParticle(Particle particle, float vx, float vy, float vz, double time) {
this.particle = particle;
this.customVelocity = true;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.time = time;
}
public SimpleParticle(Particle particle, float vx, float vy, float vz, double time, int count) {
this.particle = particle;
this.customVelocity = true;
this.vx = vx;
this.vy = vy;
this.vz = vz;
this.time = time;
this.count = count;
}
public SimpleParticle(Particle particle, double time, int count) {
this.particle = particle;
this.time = time;
this.count = count;
}
@Override
public void tick(ParticleTickData particleTickData) {
Location location = particleTickData.getLocation().add(0.0, 0.2, 0.0);
display(location, particleTickData.getPlayer(), particleTickData.isOnlySelf(), particleTickData.isOnlyOthers(), player -> {
if (customVelocity) {
player.spawnParticle(particle, location, count, vx, vy, vz, time);
} else {
player.spawnParticle(particle, location, count);
}
});
}
}