Record Class RandomBooleanSelectorFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.RandomBooleanSelectorFeature
- All Implemented Interfaces:
Feature
public record RandomBooleanSelectorFeature(Holder<PlacedFeature> featureTrue, Holder<PlacedFeature> featureFalse)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RandomBooleanSelectorFeature> private final Holder<PlacedFeature> The field for thefeatureFalserecord component.private final Holder<PlacedFeature> The field for thefeatureTruerecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionRandomBooleanSelectorFeature(Holder<PlacedFeature> featureTrue, Holder<PlacedFeature> featureFalse) Creates an instance of aRandomBooleanSelectorFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<RandomBooleanSelectorFeature> codec()final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefeatureFalserecord component.Returns the value of thefeatureTruerecord component.final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
featureTrue
The field for thefeatureTruerecord component. -
featureFalse
The field for thefeatureFalserecord component. -
CODEC
-
-
Constructor Details
-
RandomBooleanSelectorFeature
public RandomBooleanSelectorFeature(Holder<PlacedFeature> featureTrue, Holder<PlacedFeature> featureFalse) Creates an instance of aRandomBooleanSelectorFeaturerecord class.- Parameters:
featureTrue- the value for thefeatureTruerecord componentfeatureFalse- the value for thefeatureFalserecord component
-
-
Method Details
-
codec
-
getSubFeatures
- Specified by:
getSubFeaturesin interfaceFeature
-
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). -
featureTrue
Returns the value of thefeatureTruerecord component.- Returns:
- the value of the
featureTruerecord component
-
featureFalse
Returns the value of thefeatureFalserecord component.- Returns:
- the value of the
featureFalserecord component
-