Class NoiseFilter

java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.NoiseFilter
All Implemented Interfaces:
Mask

public class NoiseFilter extends AbstractMask
A mask that uses a noise generator and returns true whenever the noise generator returns a value above the given density.
  • Constructor Details

    • NoiseFilter

      public NoiseFilter(NoiseGenerator noiseGenerator, double density)
      Create a new noise filter.
      Parameters:
      noiseGenerator - the noise generator
      density - the density
  • Method Details

    • getNoiseGenerator

      public NoiseGenerator getNoiseGenerator()
      Get the noise generator.
      Returns:
      the noise generator
    • setNoiseGenerator

      public void setNoiseGenerator(NoiseGenerator noiseGenerator)
      Set the noise generator.
      Parameters:
      noiseGenerator - a noise generator
    • getDensity

      public double getDensity()
      Get the probability of passing as a number between 0 and 1 (inclusive).
      Returns:
      the density
    • setDensity

      public void setDensity(double density)
      Set the probability of passing as a number between 0 and 1 (inclusive).
    • test

      public boolean test(BlockVector3 vector)
      Description copied from interface: Mask
      Returns true if the criteria is met.
      Parameters:
      vector - the vector to test
      Returns:
      true if the criteria is met
    • toMask2D

      @Nullable public Mask2D toMask2D()
      Description copied from interface: Mask
      Get the 2D version of this mask if one exists.
      Returns:
      a 2D mask version or null if this mask can't be 2D