Class NoiseFilter2D
java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask2D
com.sk89q.worldedit.function.mask.NoiseFilter2D
- All Implemented Interfaces:
Mask2D
A mask that uses a noise generator and returns true whenever the noise
generator returns a value above the given density.
-
Constructor Summary
ConstructorsConstructorDescriptionNoiseFilter2D(NoiseGenerator noiseGenerator, double density)
Create a new noise filter. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the probability of passing as a number between 0 and 1 (inclusive).Get the noise generator.void
setDensity(double density)
Set the probability of passing as a number between 0 and 1 (inclusive).void
setNoiseGenerator(NoiseGenerator noiseGenerator)
Set the noise generator.boolean
test(BlockVector2 pos)
Returns true if the criteria is met.
-
Constructor Details
-
NoiseFilter2D
Create a new noise filter.- Parameters:
noiseGenerator
- the noise generatordensity
- the density
-
-
Method Details
-
getNoiseGenerator
Get the noise generator.- Returns:
- the noise generator
-
setNoiseGenerator
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
Description copied from interface:Mask2D
Returns true if the criteria is met.- Parameters:
pos
- the vector to test- Returns:
- true if the criteria is met
-