Class ElectricParticleEffect

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

public class ElectricParticleEffect extends WbsParticleEffect
A particle effect that spawns many small lines in a random pattern around a location, similar to sparks
  • Constructor Details

    • ElectricParticleEffect

      public ElectricParticleEffect()
      Creates the effect with the following values:
      • Radius: 0.5
      • Speed: 0
      • Arc Length: 0.25
      • Ticks: 2
    • ElectricParticleEffect

      protected ElectricParticleEffect(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 ElectricParticleEffect 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 ElectricParticleEffect 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 ElectricParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location loc, @Nullable @Nullable org.bukkit.entity.Player player)
      Description copied from class: WbsParticleEffect
      Run the effect pattern at the given location with the given particle. For shapes needing two locations (such as Line), a random second location will be chosen a random number of blocks away from the given location.
      Specified by:
      play in class WbsParticleEffect
      Parameters:
      particle - The particle type to use
      loc - The location at which to run the effect.
      player - The only play who will see it
      Returns:
      The same object.
    • play

      public ElectricParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location loc)
      Description copied from class: WbsParticleEffect
      Run the effect pattern at the given location with the given particle. For shapes needing two locations (such as Line), a random second location will be chosen a random number of blocks away from the given location.
      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 object.
    • getRadius

      public double getRadius()
      Returns:
      The radius within which arcs can appear
    • getRadiusProvider

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

      public ElectricParticleEffect setRadius(double radius)
      Parameters:
      radius - The radius within which arcs can appear
      Returns:
      The same particle effect
    • setRadius

      public ElectricParticleEffect setRadius(NumProvider radius)
      Set the radius provider directly
      Parameters:
      radius - The radius within which arcs can appear
      Returns:
      The same particle effect
    • getSpeed

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

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

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

      public ElectricParticleEffect setSpeed(NumProvider speed)
      Set the speed provider directly
      Parameters:
      speed - The speed of spawned particles in a random direction
      Returns:
      The same particle effect
    • getArcLength

      public double getArcLength()
      Returns:
      How long the spawned arcs should be
    • getArcLengthProvider

      public NumProvider getArcLengthProvider()
      Gets the arc length directly
      Returns:
      The arc length provider
    • setArcLength

      public ElectricParticleEffect setArcLength(double arcLength)
      Parameters:
      arcLength - How long the spawned arcs should be
      Returns:
      The same particle effect
    • setArcLength

      public ElectricParticleEffect setArcLength(NumProvider arcLength)
      Set the arc length directly
      Parameters:
      arcLength - How long the spawned arcs should be
      Returns:
      The same particle effect
    • getTicks

      public int getTicks()
      Returns:
      How many ticks to play the effect for
    • setTicks

      public ElectricParticleEffect setTicks(int ticks)
      Parameters:
      ticks - How many ticks to play the effect for
      Returns:
      The same particle effect
    • setTicks

      public ElectricParticleEffect setTicks(NumProvider ticks)
      Set the ticks provider directly
      Parameters:
      ticks - How many ticks to play the effect for
      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