Record Class PlacedFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.placement.PlacedFeature
public record PlacedFeature(Holder<Feature> feature, List<PlacementModifier> placement)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Holder<PlacedFeature>> static final com.mojang.serialization.Codec<PlacedFeature> The field for thefeaturerecord component.static final com.mojang.serialization.Codec<HolderSet<PlacedFeature>> static final com.mojang.serialization.Codec<List<HolderSet<PlacedFeature>>> private final List<PlacementModifier> The field for theplacementrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPlacedFeature(Holder<Feature> 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.feature()Returns the value of thefeaturerecord component.final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator generator, RandomSource random, BlockPos origin) Returns the value of theplacementrecord component.toString()Returns a string representation of this record class.
-
Field Details
-
feature
-
placement
The field for theplacementrecord component. -
DIRECT_CODEC
-
CODEC
-
LIST_CODEC
-
LIST_OF_LISTS_CODEC
public static final com.mojang.serialization.Codec<List<HolderSet<PlacedFeature>>> LIST_OF_LISTS_CODEC
-
-
Constructor Details
-
PlacedFeature
Creates an instance of aPlacedFeaturerecord class.- Parameters:
feature- the value for thefeaturerecord componentplacement- the value for theplacementrecord component
-
-
Method Details
-
place
public boolean place(WorldGenLevel level, ChunkGenerator generator, RandomSource random, BlockPos origin) -
getFeatures
-
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
Returns the value of theplacementrecord component.- Returns:
- the value of the
placementrecord component
-