Class LineParticleEffect

java.lang.Object
wbs.utils.util.particles.WbsParticleEffect
wbs.utils.util.particles.LineParticleEffect

public class LineParticleEffect extends WbsParticleEffect
A particle effect that spawns points on a line between two points
  • Constructor Details

    • LineParticleEffect

      public LineParticleEffect()
    • LineParticleEffect

      protected LineParticleEffect(org.bukkit.configuration.ConfigurationSection section, WbsSettings settings, String directory)
      Create this effect from a ConfigurationSection, logging errors in the given settings
      Parameters:
      section - The section where this effect is defined
      settings - The settings to log errors against
      directory - The path taken through the config to get to this point, for logging purposes
  • Method Details

    • clone

      public LineParticleEffect clone()
      Specified by:
      clone in class WbsParticleEffect
    • refreshProviders

      protected void refreshProviders()
      Description copied from class: WbsParticleEffect
      Refresh all providers for this object. Subclasses may override this, but should call super.refreshProviders() at the start of the method
      Overrides:
      refreshProviders in class WbsParticleEffect
    • build

      public LineParticleEffect build()
      Description copied from class: WbsParticleEffect
      Generate the particle set based on current settings. Call this before the first time it is run, or call buildAndRun each time to run based on current settings.
      Specified by:
      build in class WbsParticleEffect
      Returns:
      The same object.
    • play

      public LineParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location loc)
      Run the effect pattern at the given location with the given particle. As Line needs a second location, this method generates a random second location within a radius of 1 of loc. Or, if the end position is set and random is false, the end location will be used.
      Specified by:
      play in class WbsParticleEffect
      Parameters:
      particle - The particle type to use
      loc - The location at which to run the effect.
      Returns:
      The same particle effect
    • play

      public LineParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location loc, org.bukkit.entity.Player player)
      Run the effect pattern at the given location with the given particle. As Line needs a second location, this method generates a random second location within a radius of 1 of loc. Or, if the end position is set and random is false, the end location will be used.
      Specified by:
      play in class WbsParticleEffect
      Parameters:
      particle - The particle type to use
      loc - The location at which to run the effect.
      player - The player to see the particles
      Returns:
      The same particle effect
    • play

      public LineParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location finish, org.bukkit.entity.Player player)
      Draws a line with particles between start and finish
      Parameters:
      particle - The particle type to use
      start - The location at which to run the effect.
      finish - The end of the line.
      player - The player to see the particles
      Returns:
      The same particle effect
    • play

      public LineParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location start, org.bukkit.Location finish)
      Draws a line with particles between start and finish
      Parameters:
      particle - The particle type to use
      start - The location at which to run the effect.
      finish - The end of the line.
      Returns:
      The same particle effect
    • getRadius

      public double getRadius()
      Returns:
      The thickness of the line
    • getRadiusProvider

      public NumProvider getRadiusProvider()
      Gets the radius provider directly
      Returns:
      The radius provider
    • setRadius

      public LineParticleEffect setRadius(double radius)
      Parameters:
      radius - The thickness of the line
      Returns:
      The same particle effect
    • setRadius

      public LineParticleEffect setRadius(NumProvider radius)
      Set the radius provider directly
      Parameters:
      radius - The thickness of the line
      Returns:
      The same particle effect
    • getSpeed

      public double getSpeed()
      Returns:
      The speed spawned particles will go in a random direction
    • getSpeedProvider

      public NumProvider getSpeedProvider()
      Gets the speed provider directly
      Returns:
      The speed provider
    • setSpeed

      public LineParticleEffect setSpeed(double speed)
      Parameters:
      speed - The speed spawned particles will go in a random direction
      Returns:
      The same particle effect
    • setSpeed

      public LineParticleEffect setSpeed(NumProvider speed)
      Set the speed provider directly
      Parameters:
      speed - The speed spawned particles will go in a random direction
      Returns:
      The same particle effect
    • getScaleAmount

      public boolean getScaleAmount()
      Returns:
      Whether or not to use the amount value as points-block-block
    • setScaleAmount

      public LineParticleEffect setScaleAmount(boolean scaleAmount)
      Parameters:
      scaleAmount - Whether or not to use the amount value as points-block-block
      Returns:
      The same particle effect
    • getRandom

      public boolean getRandom()
      Returns:
      Whether or not the other end of the line should be random when play(Particle, Location) is called without a second location. When false, the end point must have been set with setEnd(Vector)
    • setRandom

      public LineParticleEffect setRandom(boolean random)
      Parameters:
      random - Whether or not the other end of the line should be random when play(Particle, Location) is called without a second location. When false, the end point must have been set with setEnd(Vector)
      Returns:
      The same particle effect
    • getEnd

      public org.bukkit.util.Vector getEnd()
      Returns:
      The end point to use when setRandom(boolean) has been set to false
    • getEndProvider

      public VectorProvider getEndProvider()
      Gets the end point provider directly
      Returns:
      The end point provider
    • setEnd

      public LineParticleEffect setEnd(org.bukkit.util.Vector end)
      Parameters:
      end - The end point to use when setRandom(boolean) has been set to false
      Returns:
      The same particle effect
    • setEnd

      public LineParticleEffect setEnd(VectorProvider end)
      Set the end provider directly
      Parameters:
      end - The end point to use when setRandom(boolean) has been set to false
      Returns:
      The same particle effect
    • writeToConfig

      public void writeToConfig(org.bukkit.configuration.ConfigurationSection section, String path)
      Description copied from class: WbsParticleEffect
      Overrides:
      writeToConfig in class WbsParticleEffect
      Parameters:
      section - The section to write to
      path - The field/path inside the given section