Record Class BambooFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.BambooFeature
- All Implemented Interfaces:
Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final BlockStateprivate static final BlockStateprivate static final BlockStateprivate static final BlockStatestatic final com.mojang.serialization.MapCodec<BambooFeature> private final floatThe field for theprobabilityrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionBambooFeature(float probability) Creates an instance of aBambooFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<BambooFeature> 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) floatReturns the value of theprobabilityrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
probability
private final float probabilityThe field for theprobabilityrecord component. -
BAMBOO_TRUNK
-
BAMBOO_FINAL_LARGE
-
BAMBOO_TOP_LARGE
-
BAMBOO_TOP_SMALL
-
CODEC
-
-
Constructor Details
-
BambooFeature
public BambooFeature(float probability) Creates an instance of aBambooFeaturerecord class.- Parameters:
probability- the value for theprobabilityrecord 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 with thecomparemethod from their corresponding wrapper classes. -
probability
public float probability()Returns the value of theprobabilityrecord component.- Returns:
- the value of the
probabilityrecord component
-