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
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Holder<PlacedFeature>>
static final com.mojang.serialization.Codec<PlacedFeature>
private final Holder<ConfiguredFeature<?,
?>> The field for thefeature
record 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 theplacement
record component. -
Constructor Summary
ConstructorDescriptionPlacedFeature
(Holder<ConfiguredFeature<?, ?>> feature, List<PlacementModifier> placement) Creates an instance of aPlacedFeature
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.Holder<ConfiguredFeature<?,
?>> feature()
Returns the value of thefeature
record component.Stream<ConfiguredFeature<?,
?>> final int
hashCode()
Returns a hash code value for this object.boolean
place
(WorldGenLevel p_191783_, ChunkGenerator p_191784_, Random p_191785_, BlockPos p_191786_) Returns the value of theplacement
record component.boolean
placeWithBiomeCheck
(WorldGenLevel p_191807_, ChunkGenerator p_191808_, Random p_191809_, BlockPos p_191810_) private boolean
placeWithContext
(PlacementContext p_191798_, Random p_191799_, BlockPos p_191800_) toString()
Returns a string representation of this record class.
-
Field Details
-
feature
The field for thefeature
record component. -
placement
The field for theplacement
record 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 aPlacedFeature
record class.- Parameters:
feature
- the value for thefeature
record componentplacement
- the value for theplacement
record component
-
-
Method Details
-
place
public boolean place(WorldGenLevel p_191783_, ChunkGenerator p_191784_, Random p_191785_, BlockPos p_191786_) -
placeWithBiomeCheck
public boolean placeWithBiomeCheck(WorldGenLevel p_191807_, ChunkGenerator p_191808_, Random p_191809_, BlockPos p_191810_) -
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 thefeature
record component.- Returns:
- the value of the
feature
record component
-
placement
Returns the value of theplacement
record component.- Returns:
- the value of the
placement
record component
-