Class ParticleUtils

java.lang.Object
dev.sefiraat.sefilib.misc.ParticleUtils

public final class ParticleUtils extends Object
This class contains basic utility methods for creating particles
  • Method Details

    • displayParticleRandomly

      @ParametersAreNonnullByDefault public static void displayParticleRandomly(Entity entity, Particle particle, double rangeRadius)
      Creates 5 particle effects at the provided location with a random offset
      Parameters:
      entity - The entity to create the particles around
      particle - The particle to create
      rangeRadius - The radius of the area to create the particles in
    • displayParticleRandomly

      @ParametersAreNonnullByDefault public static void displayParticleRandomly(Location location, Particle particle, double rangeRadius, int numberOfParticles)
      Creates the specified amount of particle effects at the provided location with a random offset
      Parameters:
      location - The location to create the particles around
      particle - The particle to create
      rangeRadius - The radius of the area to create the particles in
      numberOfParticles - The amount of particles to create
    • displayParticleRandomly

      @ParametersAreNonnullByDefault public static void displayParticleRandomly(Entity entity, Particle particle, double rangeRadius, int numberOfParticles)
      Creates a particle effect at the provided location
      Parameters:
      entity - The entity to create the particles around
      particle - The particle to create
      rangeRadius - The radius of the area to create the particles in
      numberOfParticles - The amount of particles to create
    • displayParticleRandomly

      @ParametersAreNonnullByDefault public static void displayParticleRandomly(Location location, Particle particle, double rangeRadius)
      Creates a particle effect at the provided location
      Parameters:
      location - The location to create the particles around
      particle - The particle to create
      rangeRadius - The radius of the area to create the particles in
    • displayParticleRandomly

      @ParametersAreNonnullByDefault public static void displayParticleRandomly(Entity entity, double rangeRadius, int numberOfParticles, Particle.DustOptions dustOptions)
      Creates a dust particle effect at the provided location
      Parameters:
      entity - The entity to create the particles around
      rangeRadius - The radius of the area to create the particles in
      numberOfParticles - The amount of particles to create
      dustOptions - The options for the dust particle
    • displayParticleRandomly

      @ParametersAreNonnullByDefault public static void displayParticleRandomly(Location location, double rangeRadius, int numberOfParticles, Particle.DustOptions dustOptions)
      Creates a dust particle effect at the provided location
      Parameters:
      location - The location to create the particles around
      rangeRadius - The radius of the area to create the particles in
      numberOfParticles - The amount of particles to create
      dustOptions - The options for the dust particle
    • displayParticleRandomly

      @ParametersAreNonnullByDefault public static void displayParticleRandomly(Entity entity, double rangeRadius, Particle.DustOptions dustOptions)
      Creates a dust particle effect at the provided location
      Parameters:
      entity - The entity to create the particles around
      rangeRadius - The radius of the area to create the particles in
      dustOptions - The options for the dust particle
    • drawLine

      @ParametersAreNonnullByDefault public static void drawLine(Particle particle, Location start, Location end, double space)
      Creates a line of particles from the provided location to the provided target location
      Parameters:
      particle - The particle to create
      start - The location to start the line from
      end - The location to end the line at
      space - The space between each particle
    • drawLine

      @ParametersAreNonnullByDefault public static void drawLine(Particle particle, Location start, Location end, double space, @Nullable Particle.DustOptions dustOptions)
      Creates a line of particles from the provided location to the provided target location
      Parameters:
      particle - The particle to create
      start - The location to start the line from
      end - The location to end the line at
      space - The space between each particle
      dustOptions - The options for the dust particle
    • drawLine

      @ParametersAreNonnullByDefault public static void drawLine(Particle.DustOptions dustOptions, Location start, Location end, double space)
      Creates a line of dust particles from the provided location to the provided target location
      Parameters:
      dustOptions - The options for the dust particle
      start - The location to start the line from
      end - The location to end the line at
      space - The space between each particle
    • getLine

      @Nonnull @ParametersAreNonnullByDefault public static List<Location> getLine(Location start, Location end, double space)
      Creates a line of Locations from the provided location to the provided target location
      Parameters:
      start - The location to start the line from
      end - The location to end the line at
      space - The space between each location
      Returns:
      A list of locations between the start and end location
    • drawCube

      @ParametersAreNonnullByDefault public static void drawCube(Particle particle, Location corner1, Location corner2, double space)
      Draws a cubic shape of particles at the provided location
      Parameters:
      particle - The particle to create
      corner1 - The first corner of the cube
      corner2 - The second corner of the cube
      space - The space between each particle
    • drawCube

      @ParametersAreNonnullByDefault public static void drawCube(Particle particle, Location corner1, Location corner2, double particleDistance, @Nullable Particle.DustOptions dustOptions)
      Draws a cubic shape of particles at the provided location https://www.spigotmc.org/threads/create-particles-in-cube-outline-shape.65991/
      Parameters:
      particle - The particle to create
      corner1 - The first corner of the cube
      corner2 - The second corner of the cube
      particleDistance - The distance between each particle
      dustOptions - The options for the dust particle
    • drawCube

      @ParametersAreNonnullByDefault public static void drawCube(Particle.DustOptions dustOptions, Location corner1, Location corner2, double space)
      Draws a cubic shape of dust particles at the provided location
      Parameters:
      dustOptions - The options for the dust particle
      corner1 - The first corner of the cube
      corner2 - The second corner of the cube
      space - The space between each particle