Class NoiseThresholdModifier
java.lang.Object
com.github.darksoulq.abyssallib.world.gen.placement.PlacementModifier
com.github.darksoulq.abyssallib.world.gen.placement.modifier.NoiseThresholdModifier
A placement modifier that filters positions based on 2D simplex noise.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<NoiseThresholdModifier> The codec used for serializing and deserializing the noise threshold modifier.static final PlacementModifierType<NoiseThresholdModifier> The registered type definition for the noise threshold placement modifier. -
Constructor Summary
ConstructorsConstructorDescriptionNoiseThresholdModifier(double frequency, double threshold, boolean aboveThreshold) Constructs a new NoiseThresholdModifier. -
Method Summary
Modifier and TypeMethodDescriptionStream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Filters the incoming positions by evaluating a 2D simplex noise value at the given coordinates.getType()Retrieves the specific type definition for this modifier.
-
Field Details
-
CODEC
The codec used for serializing and deserializing the noise threshold modifier. -
TYPE
The registered type definition for the noise threshold placement modifier.
-
-
Constructor Details
-
NoiseThresholdModifier
public NoiseThresholdModifier(double frequency, double threshold, boolean aboveThreshold) Constructs a new NoiseThresholdModifier.- Parameters:
frequency- The sampling frequency.threshold- The noise threshold.aboveThreshold- True if the noise must exceed the threshold, false if it must be below.
-
-
Method Details
-
getPositions
public Stream<org.bukkit.util.Vector> getPositions(PlacementContext context, Stream<org.bukkit.util.Vector> positions) Filters the incoming positions by evaluating a 2D simplex noise value at the given coordinates.- Specified by:
getPositionsin classPlacementModifier- Parameters:
context- The current placement context.positions- The incoming stream of potential placement vectors.- Returns:
- A filtered stream containing only vectors that passed the noise check.
-
getType
Retrieves the specific type definition for this modifier.- Specified by:
getTypein classPlacementModifier- Returns:
- The placement modifier type associated with this noise threshold modifier.
-