Record Class ReplaceBlockFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.ReplaceBlockFeature
- All Implemented Interfaces:
Feature
public record ReplaceBlockFeature(List<BlockReplacement> replacements)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ReplaceBlockFeature> private final List<BlockReplacement> The field for thereplacementsrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionReplaceBlockFeature(List<BlockReplacement> replacements) Creates an instance of aReplaceBlockFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<ReplaceBlockFeature> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) Returns the value of thereplacementsrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
replacements
The field for thereplacementsrecord component. -
CODEC
-
-
Constructor Details
-
ReplaceBlockFeature
Creates an instance of aReplaceBlockFeaturerecord class.- Parameters:
replacements- the value for thereplacementsrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
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). -
replacements
Returns the value of thereplacementsrecord component.- Returns:
- the value of the
replacementsrecord component
-