Record Class PlacedFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.placement.PlacedFeature
public record PlacedFeature(Holder<ConfiguredFeature<?,?>> 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> private final Holder<ConfiguredFeature<?, ?>> 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<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.Holder<ConfiguredFeature<?, ?>> feature()Returns the value of thefeaturerecord component.Stream<ConfiguredFeature<?, ?>> final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel pLevel, ChunkGenerator pGenerator, RandomSource pRandom, BlockPos pPos) Returns the value of theplacementrecord component.booleanplaceWithBiomeCheck(WorldGenLevel pLevel, ChunkGenerator pGenerator, RandomSource pRandom, BlockPos pPos) private booleanplaceWithContext(PlacementContext pContext, RandomSource pSource, BlockPos pPos) toString()Returns a string representation of this record class.
-
Field Details
-
feature
The field for thefeaturerecord component. -
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 pLevel, ChunkGenerator pGenerator, RandomSource pRandom, BlockPos pPos) -
placeWithBiomeCheck
public boolean placeWithBiomeCheck(WorldGenLevel pLevel, ChunkGenerator pGenerator, RandomSource pRandom, BlockPos pPos) -
placeWithContext
-
getFeatures
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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
Returns the value of thefeaturerecord component.- Returns:
- the value of the
featurerecord component
-
placement
Returns the value of theplacementrecord component.- Returns:
- the value of the
placementrecord component
-