Class Generators
java.lang.Object
com.github.darksoulq.abyssallib.world.particle.impl.Generators
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic Generatorcircle(double radius, int points) Generates a flat circle on the XZ plane.static Generatorcube(double size, int resolution) Generates the wireframe of a cube.static GeneratordrawingCircle(double radius, int totalPoints, long duration) Generates a circle that "draws" itself over a duration.static GeneratorfromImage(BufferedImage image, double size, int density) Creates a generator that replicates aBufferedImageusing particles.static GeneratorgrowingCube(double size, int resolution, long duration) Generates a cube that "grows" from bottom to top over a duration.static Generatorhelix(double radius, double height, int turns, int points, double speed) Generates a 3D helix (spiral) shape.static Generatorline(org.bukkit.util.Vector start, org.bukkit.util.Vector end, double step) Generates a line of particles between two points.static Generatororbit(double radius, int points, double speed) Generates a circular orbit animation.static Generatorpoint()static GeneratorpulsingCircle(double baseRadius, double pulseAmplitude, double speed, int points) Generates a circle that pulses (changes radius) over time.static Generatorpyramid(double size, double height, int resolution) Generates a pyramid shape.static GeneratorrotatingCircle(double radius, int points, double speed) Generates a circle that rotates around the Y axis over time.static GeneratorsineWave(double length, int points, double amplitude, double frequency, double speed) Generates a moving sine wave.static Generatorsphere(double radius, int points) Generates a 3D sphere using a Fibonacci spiral distribution.static Generatorspiral(double maxRadius, double height, int points, double speed) Generates a cone-like spiral starting from a point.static Generatorsquare(double size, int pointsPerSide) Generates a flat square outline on the XZ plane.static GeneratorConverts a string of text into white particles.static Generatortext(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.
-
Constructor Details
-
Generators
public Generators()
-
-
Method Details
-
fromImage
Creates a generator that replicates aBufferedImageusing 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
Generatorrepresenting 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- TheColorProviderfor 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
Generatorrepresenting 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
Generatorfor plain text.
-
point
- Returns:
- A generator producing a single point at (0,0,0).
-
line
Generates a line of particles between two points.- Parameters:
start- The startingVector.end- The endingVector.step- The distance between each particle.- Returns:
- A
Generatorfor a line.
-
circle
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
Generatorfor a circle.
-
square
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
Generatorfor a square.
-
sphere
Generates a 3D sphere using a Fibonacci spiral distribution.- Parameters:
radius- The radius of the sphere.points- The total number of particles.- Returns:
- A
Generatorfor a sphere.
-
cube
Generates the wireframe of a cube.- Parameters:
size- The edge length.resolution- The number of particles per edge.- Returns:
- A
Generatorfor a cube.
-
pyramid
Generates a pyramid shape.- Parameters:
size- The base width.height- The height.resolution- The particle density per layer.- Returns:
- A
Generatorfor a pyramid.
-
rotatingCircle
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
Generates a circular orbit animation.- Parameters:
radius- The orbit radius.points- The particle count.speed- The orbital speed.- Returns:
- A dynamic
Generator.
-
drawingCircle
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
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
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
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.
-