Class NoiseFilter
java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.NoiseFilter
- All Implemented Interfaces:
Mask
A mask that uses a noise generator and returns true whenever the noise
generator returns a value above the given density.
-
Constructor Summary
ConstructorDescriptionNoiseFilter
(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
(BlockVector3 vector) Returns true if the criteria is met.toMask2D()
Get the 2D version of this mask if one exists.
-
Constructor Details
-
NoiseFilter
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:Mask
Returns true if the criteria is met.- Parameters:
vector
- the vector to test- Returns:
- true if the criteria is met
-
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
-