package vg.civcraft.mc.civmodcore.particles;

import org.bukkit.Location;
import org.bukkit.Particle;

public class ParticleEffect {

	private Particle particle;

	private float offsetX;

	private float offsetY;

	private float offsetZ;

	private float speed;

	private int particleCount;

	public ParticleEffect(Particle particle, float offsetX, float offsetY, float offsetZ, float speed, int particleCount) {
		this.particle = particle;
		this.offsetX = offsetX;
		this.offsetY = offsetY;
		this.offsetZ = offsetZ;
		this.speed = speed;
		this.particleCount = particleCount;
	}

	/**
	 * @return the type of particle used in this effect
	 */
	public Particle getParticle() {
		return particle;
	}

	/**
	 * @return the amount to be randomly offset by in the X axis
	 */
	public float getOffsetX() {
		return offsetX;
	}

	/**
	 * @return the amount to be randomly offset by in the Y axis
	 */
	public float getOffsetY() {
		return offsetY;
	}

	/**
	 * @return the amount to be randomly offset by in the Z axis
	 */
	public float getOffsetZ() {
		return offsetZ;
	}

	/**
	 * @return the speed of the particles
	 */
	public float getSpeed() {
		return speed;
	}

	/**
	 * @return the amount of particle to display.
	 */
	public int getParticleCount() {
		return particleCount;
	}

	/**
	 * Display an effect defined in the config around a reinforcement.
	 *
	 * @param location
	 *            the location of the reinforcement.
	 */
	public void playEffect(Location location) {
		location.getWorld().spawnParticle(particle, location, particleCount, offsetX, offsetY, offsetZ, speed, null);
	}

	@Override
	public String toString() {
		return String.format("  type: %s \n   offsetX: %f \n   offsetY: %f \n   offsetZ: %f \n   speed:"
						+ " " + "%f \n   particleCount: %d", particle, offsetX, offsetY, offsetZ, speed, particleCount);
	}

}

package vg.civcraft.mc.civmodcore.particles;

import javax.annotation.Nonnull;
import lombok.NonNull;
import org.bukkit.Location;
import org.bukkit.Particle;

/**
 * @param particle The type of particle to effect, ie: explosion, heart, lava... etc
 * @param offsetX The maximum randomised offset on the X axis.
 * @param offsetY The maximum randomised offset on the Y axis.
 * @param offsetZ The maximum randomised offset on the Z axis.
 * @param speed The speed of the effect.
 * @param particleCount The number (density) of the particle effect.
 */
public record ParticleEffect(@NonNull Particle particle,
							 float offsetX,
							 float offsetY,
							 float offsetZ,
							 float speed,
							 int particleCount) {

	@Deprecated
	public Particle getParticle() {
		return this.particle;
	}

	@Deprecated
	public float getOffsetX() {
		return this.offsetX;
	}

	@Deprecated
	public float getOffsetY() {
		return this.offsetY;
	}

	@Deprecated
	public float getOffsetZ() {
		return this.offsetZ;
	}

	@Deprecated
	public float getSpeed() {
		return this.speed;
	}

	@Deprecated
	public int getParticleCount() {
		return this.particleCount;
	}

	/**
	 * Display an effect defined in the config around a reinforcement.
	 *
	 * @param location the location of the reinforcement.
	 */
	public void playEffect(@Nonnull final Location location) {
		location.getWorld().spawnParticle(this.particle, location, this.particleCount,
				this.offsetX, this.offsetY, this.offsetZ, this.speed, null);
	}

}

Update ParticleEffect