Class Particles.Builder

java.lang.Object
com.github.darksoulq.abyssallib.world.particle.Particles.Builder
Enclosing class:
Particles

public static class Particles.Builder extends Object
Fluent builder class for Particles.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • origin

      public Particles.Builder origin(org.bukkit.Location loc)
      Sets a static location for the effect's origin.
      Parameters:
      loc - The world location.
      Returns:
      This builder.
    • origin

      public Particles.Builder origin(Supplier<org.bukkit.Location> loc)
      Sets a dynamic supplier for the effect's origin.
      Parameters:
      loc - The supplier for the location.
      Returns:
      This builder.
    • shape

      public Particles.Builder shape(Generator g)
      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

      public Particles.Builder transform(Transformer t)
      Adds a custom transformer to the transformation pipeline.
      Parameters:
      t - The spatial transformer.
      Returns:
      This builder.
    • color

      public Particles.Builder color(org.bukkit.Color color)
      Sets a static color for all particles.
      Parameters:
      color - The Bukkit Color.
      Returns:
      This builder.
    • color

      public Particles.Builder color(ColorProvider provider)
      Sets a procedural color provider for dynamic particle tinting.
      Parameters:
      provider - The color provider.
      Returns:
      This builder.
    • rotate

      public Particles.Builder rotate(double x, double y, double z)
      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

      public Particles.Builder scale(double s)
      Adds a scaling transformation to the pipeline.
      Parameters:
      s - The multiplier to apply to coordinates.
      Returns:
      This builder.
    • offset

      public Particles.Builder offset(double x, double y, double z)
      Adds a spatial offset transformation to the pipeline.
      Parameters:
      x - X offset.
      y - Y offset.
      z - Z offset.
      Returns:
      This builder.
    • interval

      public Particles.Builder interval(long i)
      Sets the execution frequency.
      Parameters:
      i - Delay in ticks between frames.
      Returns:
      This builder.
    • duration

      public Particles.Builder duration(long d)
      Sets the total lifetime of the effect.
      Parameters:
      d - Duration in ticks.
      Returns:
      This builder.
    • smooth

      public Particles.Builder smooth(boolean s)
      Sets whether to calculate velocity for smooth client-side interpolation.
      Parameters:
      s - True for smooth, false for discrete frames.
      Returns:
      This builder.
    • viewers

      public Particles.Builder viewers(List<org.bukkit.entity.Player> players)
      Sets a static list of players who can perceive the effect.
      Parameters:
      players - The list of players.
      Returns:
      This builder.
    • viewers

      public Particles.Builder viewers(Supplier<List<org.bukkit.entity.Player>> 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

      public Particles build()
      Validates the configuration and produces a Particles instance.
      Returns:
      The configured Particles instance.
      Throws:
      IllegalStateException - If required components (origin, shape, render) are missing.