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_226358_, ChunkGenerator p_226359_, RandomSource p_226360_, BlockPos p_226361_) Returns the value of theplacement
record component.boolean
placeWithBiomeCheck
(WorldGenLevel p_226378_, ChunkGenerator p_226379_, RandomSource p_226380_, BlockPos p_226381_) private boolean
placeWithContext
(PlacementContext p_226369_, RandomSource p_226370_, BlockPos p_226371_) 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_226358_, ChunkGenerator p_226359_, RandomSource p_226360_, BlockPos p_226361_) -
placeWithBiomeCheck
public boolean placeWithBiomeCheck(WorldGenLevel p_226378_, ChunkGenerator p_226379_, RandomSource p_226380_, BlockPos p_226381_) -
placeWithContext
private boolean placeWithContext(PlacementContext p_226369_, RandomSource p_226370_, BlockPos p_226371_) -
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
-