Class Particles.Builder
java.lang.Object
com.github.darksoulq.abyssallib.world.particle.Particles.Builder
- Enclosing class:
Particles
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Validates the configuration and produces a Particles instance.color(ColorProvider provider) Sets a procedural color provider for dynamic particle tinting.color(org.bukkit.Color color) Sets a static color for all particles.duration(long d) Sets the total lifetime of the effect.interval(long i) Sets the execution frequency.offset(double x, double y, double z) Adds a spatial offset transformation to the pipeline.Sets a dynamic supplier for the effect's origin.origin(org.bukkit.Location loc) Sets a static location for the effect's origin.Sets the renderer responsible for displaying the particles.rotate(double x, double y, double z) Adds a rotation transformation to the pipeline.scale(double s) Adds a scaling transformation to the pipeline.Sets the geometric shape generator for the particles.smooth(boolean s) Sets whether to calculate velocity for smooth client-side interpolation.Sets a condition to stop the effect prematurely.Adds a custom transformer to the transformation pipeline.Sets a dynamic supplier for viewers.Sets a static list of players who can perceive the effect.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
origin
Sets a static location for the effect's origin.- Parameters:
loc- The world location.- Returns:
- This builder.
-
origin
Sets a dynamic supplier for the effect's origin.- Parameters:
loc- The supplier for the location.- Returns:
- This builder.
-
shape
Sets the geometric shape generator for the particles.- Parameters:
g- The generator logic.- Returns:
- This builder.
-
render
Sets the renderer responsible for displaying the particles.- Parameters:
r- The renderer implementation.- Returns:
- This builder.
-
transform
Adds a custom transformer to the transformation pipeline.- Parameters:
t- The spatial transformer.- Returns:
- This builder.
-
color
Sets a static color for all particles.- Parameters:
color- The BukkitColor.- Returns:
- This builder.
-
color
Sets a procedural color provider for dynamic particle tinting.- Parameters:
provider- The color provider.- Returns:
- This builder.
-
rotate
Adds a rotation transformation to the pipeline.- Parameters:
x- Rotation in radians around X.y- Rotation in radians around Y.z- Rotation in radians around Z.- Returns:
- This builder.
-
scale
Adds a scaling transformation to the pipeline.- Parameters:
s- The multiplier to apply to coordinates.- Returns:
- This builder.
-
offset
Adds a spatial offset transformation to the pipeline.- Parameters:
x- X offset.y- Y offset.z- Z offset.- Returns:
- This builder.
-
interval
Sets the execution frequency.- Parameters:
i- Delay in ticks between frames.- Returns:
- This builder.
-
duration
Sets the total lifetime of the effect.- Parameters:
d- Duration in ticks.- Returns:
- This builder.
-
smooth
Sets whether to calculate velocity for smooth client-side interpolation.- Parameters:
s- True for smooth, false for discrete frames.- Returns:
- This builder.
-
viewers
Sets a static list of players who can perceive the effect.- Parameters:
players- The list of players.- Returns:
- This builder.
-
viewers
Sets a dynamic supplier for viewers.- Parameters:
viewers- The player list supplier.- Returns:
- This builder.
-
stopIf
Sets a condition to stop the effect prematurely.- Parameters:
s- The boolean condition.- Returns:
- This builder.
-
build
Validates the configuration and produces a Particles instance.- Returns:
- The configured
Particlesinstance. - Throws:
IllegalStateException- If required components (origin, shape, render) are missing.
-