Record Class PlacedFeature
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.world.gen.placement.PlacedFeature
- Record Components:
feature- The configured feature to generate.placement- The ordered list of modifiers to apply to the initial position.
public record PlacedFeature(ConfiguredFeature<?,?> feature, List<PlacementModifier> placement)
extends Record
Represents a feature that is fully prepared for world placement.
A PlacedFeature wraps a ConfiguredFeature with an ordered list of
PlacementModifiers. It acts as the execution pipeline, translating
initial coordinates through the modifiers before delegating to the feature logic.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Codec<PlacedFeature> The universal codec for PlacedFeatures, supporting both direct object definitions and string-based registry lookups. -
Constructor Summary
ConstructorsConstructorDescriptionPlacedFeature(ConfiguredFeature<?, ?> feature, List<PlacementModifier> placement) Creates an instance of aPlacedFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.ConfiguredFeature<?, ?> feature()Returns the value of thefeaturerecord component.final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenAccess level, Random random, int chunkX, int chunkZ) Triggers the placement pipeline starting from a chunk's root coordinates.booleanplace(WorldGenAccess level, Random random, org.bukkit.Location origin) Triggers the placement pipeline starting from an absolute origin location.Returns the value of theplacementrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
The universal codec for PlacedFeatures, supporting both direct object definitions and string-based registry lookups.
-
-
Constructor Details
-
Method Details
-
place
Triggers the placement pipeline starting from a chunk's root coordinates.- Parameters:
level- The world generation accessor.random- The random source for this chunk.chunkX- The chunk X coordinate.chunkZ- The chunk Z coordinate.- Returns:
- True if the feature was successfully placed at least once.
-
place
Triggers the placement pipeline starting from an absolute origin location.This is strictly utilized by Meta Features (like RandomFeature) to execute sub-features relative to the currently evaluated position in the world.
- Parameters:
level- The world generation accessor.random- The random source.origin- The absolute starting coordinate for the modifier pipeline.- Returns:
- True if the feature was successfully placed at least once.
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
feature
-
placement
-