Class NormalParticleEffect

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

public class NormalParticleEffect extends WbsParticleEffect
A particle effect that mimics the default behaviour of particle spawning, and works the same as the vanilla /particle command.
  • Constructor Details

    • NormalParticleEffect

      public NormalParticleEffect()
    • NormalParticleEffect

      protected NormalParticleEffect(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 NormalParticleEffect 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 NormalParticleEffect 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 NormalParticleEffect play(org.bukkit.Particle particle, org.bukkit.Location loc, 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 NormalParticleEffect 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.
    • 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 NormalParticleEffect setSpeed(double speed)
      Parameters:
      speed - The speed spawned particles will go in a random direction
      Returns:
      The same particle effect
    • setSpeed

      public NormalParticleEffect 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
    • setX

      public NormalParticleEffect setX(double x)
      Set the size of the region in the X axis
      Parameters:
      x - The new size in the X axis
      Returns:
      The same particle effect
    • setY

      public NormalParticleEffect setY(double y)
      Set the size of the region in the Y axis
      Parameters:
      y - The new size in the Y axis
      Returns:
      The same particle effect
    • setZ

      public NormalParticleEffect setZ(double z)
      Set the size of the region in the Z axis
      Parameters:
      z - The new size in the Z axis
      Returns:
      The same particle effect
    • setX

      Set the X size provider directly
      Parameters:
      x - The new size in the X axis
      Returns:
      The same particle effect
    • setY

      Set the Y size provider directly
      Parameters:
      y - The new size in the Y axis
      Returns:
      The same particle effect
    • setZ

      Set the Z size provider directly
      Parameters:
      z - The new size in the Z axis
      Returns:
      The same particle effect
    • setXYZ

      public NormalParticleEffect setXYZ(double size)
      Set the size of the region in the all 3 axes, making the region a cube
      Parameters:
      size - The new size in the all axes
      Returns:
      The same particle effect
    • setXYZ

      public NormalParticleEffect setXYZ(NumProvider size)
      Set the provider of all axes directly
      Parameters:
      size - The new size in the all axes
      Returns:
      The same particle effect
    • setXYZ

      public NormalParticleEffect setXYZ(org.bukkit.util.Vector xyz)
      Set the size of the region in each axis defined by the X, Y, and Z components of a given vector
      Parameters:
      xyz - The vector representing the size of the region
      Returns:
      The same particle effect
    • getX

      public double getX()
      Returns:
      The current X axis size of this particle
    • getY

      public double getY()
      Returns:
      The current Y axis size of this particle
    • getZ

      public double getZ()
      Returns:
      The current Z axis size of this particle
    • getXProvider

      public NumProvider getXProvider()
      Gets the x provider directly
      Returns:
      The x provider
    • getYProvider

      public NumProvider getYProvider()
      Gets the y provider directly
      Returns:
      The y provider
    • getZProvider

      public NumProvider getZProvider()
      Gets the z provider directly
      Returns:
      The z provider
    • 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