Class Generators

java.lang.Object
com.github.darksoulq.abyssallib.world.particle.impl.Generators

public final class Generators extends Object
A utility class containing static factory methods for creating Generator instances.

This class includes generators for 2D/3D shapes, text-to-particle conversion, image-to-particle conversion, and dynamic path animations.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static Generator
    circle(double radius, int points)
    Generates a flat circle on the XZ plane.
    static Generator
    cube(double size, int resolution)
    Generates the wireframe of a cube.
    static Generator
    drawingCircle(double radius, int totalPoints, long duration)
    Generates a circle that "draws" itself over a duration.
    static Generator
    fromImage(BufferedImage image, double size, int density)
    Creates a generator that replicates a BufferedImage using particles.
    static Generator
    growingCube(double size, int resolution, long duration)
    Generates a cube that "grows" from bottom to top over a duration.
    static Generator
    helix(double radius, double height, int turns, int points, double speed)
    Generates a 3D helix (spiral) shape.
    static Generator
    line(org.bukkit.util.Vector start, org.bukkit.util.Vector end, double step)
    Generates a line of particles between two points.
    static Generator
    orbit(double radius, int points, double speed)
    Generates a circular orbit animation.
    static Generator
     
    static Generator
    pulsingCircle(double baseRadius, double pulseAmplitude, double speed, int points)
    Generates a circle that pulses (changes radius) over time.
    static Generator
    pyramid(double size, double height, int resolution)
    Generates a pyramid shape.
    static Generator
    rotatingCircle(double radius, int points, double speed)
    Generates a circle that rotates around the Y axis over time.
    static Generator
    sineWave(double length, int points, double amplitude, double frequency, double speed)
    Generates a moving sine wave.
    static Generator
    sphere(double radius, int points)
    Generates a 3D sphere using a Fibonacci spiral distribution.
    static Generator
    spiral(double maxRadius, double height, int points, double speed)
    Generates a cone-like spiral starting from a point.
    static Generator
    square(double size, int pointsPerSide)
    Generates a flat square outline on the XZ plane.
    static Generator
    text(String text, String fontName, int style, int fontSize, double size)
    Converts a string of text into white particles.
    static Generator
    text(String text, String fontName, int style, ColorProvider color, int fontSize, double size)
    Converts a string of text into a particle-based layout with custom coloring.

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Generators

      public Generators()
  • Method Details

    • fromImage

      public static Generator fromImage(BufferedImage image, double size, int density)
      Creates a generator that replicates a BufferedImage using particles.
      Parameters:
      image - The source image to convert.
      size - The maximum world-space size the image should occupy.
      density - The pixel skip rate (1 = every pixel, 2 = every other pixel).
      Returns:
      A Generator representing the image.
    • text

      public static Generator text(String text, String fontName, @MagicConstant(flags={0L,1L,2L}) int style, ColorProvider color, int fontSize, double size)
      Converts a string of text into a particle-based layout with custom coloring.
      Parameters:
      text - The text to display.
      fontName - The name of the font to use.
      style - The font style (e.g., Font.BOLD).
      color - The ColorProvider for the text color.
      fontSize - The size of the font in the internal buffer.
      size - The world-space width/height of the rendered text.
      Returns:
      A Generator representing the text.
    • text

      public static Generator text(String text, String fontName, @MagicConstant(flags={0L,1L,2L}) int style, int fontSize, double size)
      Converts a string of text into white particles.
      Parameters:
      text - The text.
      fontName - The font.
      style - The font style.
      fontSize - The font size.
      size - The world size.
      Returns:
      A Generator for plain text.
    • point

      public static Generator point()
      Returns:
      A generator producing a single point at (0,0,0).
    • line

      public static Generator line(org.bukkit.util.Vector start, org.bukkit.util.Vector end, double step)
      Generates a line of particles between two points.
      Parameters:
      start - The starting Vector.
      end - The ending Vector.
      step - The distance between each particle.
      Returns:
      A Generator for a line.
    • circle

      public static Generator circle(double radius, int points)
      Generates a flat circle on the XZ plane.
      Parameters:
      radius - The radius of the circle.
      points - The number of particles in the circumference.
      Returns:
      A Generator for a circle.
    • square

      public static Generator square(double size, int pointsPerSide)
      Generates a flat square outline on the XZ plane.
      Parameters:
      size - The side length of the square.
      pointsPerSide - The number of particles per edge.
      Returns:
      A Generator for a square.
    • sphere

      public static Generator sphere(double radius, int points)
      Generates a 3D sphere using a Fibonacci spiral distribution.
      Parameters:
      radius - The radius of the sphere.
      points - The total number of particles.
      Returns:
      A Generator for a sphere.
    • cube

      public static Generator cube(double size, int resolution)
      Generates the wireframe of a cube.
      Parameters:
      size - The edge length.
      resolution - The number of particles per edge.
      Returns:
      A Generator for a cube.
    • pyramid

      public static Generator pyramid(double size, double height, int resolution)
      Generates a pyramid shape.
      Parameters:
      size - The base width.
      height - The height.
      resolution - The particle density per layer.
      Returns:
      A Generator for a pyramid.
    • rotatingCircle

      public static Generator rotatingCircle(double radius, int points, double speed)
      Generates a circle that rotates around the Y axis over time.
      Parameters:
      radius - The radius.
      points - The particle count.
      speed - The rotation speed.
      Returns:
      A dynamic Generator.
    • orbit

      public static Generator orbit(double radius, int points, double speed)
      Generates a circular orbit animation.
      Parameters:
      radius - The orbit radius.
      points - The particle count.
      speed - The orbital speed.
      Returns:
      A dynamic Generator.
    • drawingCircle

      public static Generator drawingCircle(double radius, int totalPoints, long duration)
      Generates a circle that "draws" itself over a duration.
      Parameters:
      radius - The radius.
      totalPoints - The final particle count.
      duration - Ticks to complete the drawing.
      Returns:
      A dynamic Generator.
    • growingCube

      public static Generator growingCube(double size, int resolution, long duration)
      Generates a cube that "grows" from bottom to top over a duration.
      Parameters:
      size - The cube size.
      resolution - The particle density.
      duration - Ticks to reach full height.
      Returns:
      A dynamic Generator.
    • sineWave

      public static Generator sineWave(double length, int points, double amplitude, double frequency, double speed)
      Generates a moving sine wave.
      Parameters:
      length - The total wave length.
      points - The number of particles.
      amplitude - The height of the peaks.
      frequency - The wave frequency.
      speed - The wave speed (phase shift).
      Returns:
      A dynamic Generator.
    • pulsingCircle

      public static Generator pulsingCircle(double baseRadius, double pulseAmplitude, double speed, int points)
      Generates a circle that pulses (changes radius) over time.
      Parameters:
      baseRadius - The median radius.
      pulseAmplitude - The maximum change from median.
      speed - The pulse speed.
      points - The number of particles.
      Returns:
      A dynamic Generator.
    • helix

      public static Generator helix(double radius, double height, int turns, int points, double speed)
      Generates a 3D helix (spiral) shape.
      Parameters:
      radius - The radius of the helix.
      height - The total height.
      turns - The number of complete rotations.
      points - The total number of particles.
      speed - The rotation speed.
      Returns:
      A dynamic Generator.
    • spiral

      public static Generator spiral(double maxRadius, double height, int points, double speed)
      Generates a cone-like spiral starting from a point.
      Parameters:
      maxRadius - The final radius at the top.
      height - The total height.
      points - The total number of particles.
      speed - The rotation speed.
      Returns:
      A dynamic Generator.