Record Class SingleBlockPillarFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.SingleBlockPillarFeature
- All Implemented Interfaces:
Feature
public record SingleBlockPillarFeature(Holder<BlockStateProvider> block, BlockPredicate canReplace, Direction direction, float chanceToContinue, Optional<Holder<PlacedFeature>> capFeature)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder<BlockStateProvider> The field for theblockrecord component.private final BlockPredicateThe field for thecanReplacerecord component.private final Optional<Holder<PlacedFeature>> The field for thecapFeaturerecord component.private final floatThe field for thechanceToContinuerecord component.static final com.mojang.serialization.MapCodec<SingleBlockPillarFeature> private final DirectionThe field for thedirectionrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSingleBlockPillarFeature(Holder<BlockStateProvider> block, BlockPredicate mayReplace, Direction direction, float chanceToContinue) SingleBlockPillarFeature(Holder<BlockStateProvider> block, BlockPredicate canReplace, Direction direction, float chanceToContinue, Optional<Holder<PlacedFeature>> capFeature) Creates an instance of aSingleBlockPillarFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionblock()Returns the value of theblockrecord component.Returns the value of thecanReplacerecord component.Returns the value of thecapFeaturerecord component.floatReturns the value of thechanceToContinuerecord component.com.mojang.serialization.MapCodec<SingleBlockPillarFeature> codec()Returns the value of thedirectionrecord component.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) final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
block
The field for theblockrecord component. -
canReplace
The field for thecanReplacerecord component. -
direction
The field for thedirectionrecord component. -
chanceToContinue
private final float chanceToContinueThe field for thechanceToContinuerecord component. -
capFeature
The field for thecapFeaturerecord component. -
CODEC
-
-
Constructor Details
-
SingleBlockPillarFeature
public SingleBlockPillarFeature(Holder<BlockStateProvider> block, BlockPredicate mayReplace, Direction direction, float chanceToContinue) -
SingleBlockPillarFeature
public SingleBlockPillarFeature(Holder<BlockStateProvider> block, BlockPredicate canReplace, Direction direction, float chanceToContinue, Optional<Holder<PlacedFeature>> capFeature) Creates an instance of aSingleBlockPillarFeaturerecord class.- Parameters:
block- the value for theblockrecord componentcanReplace- the value for thecanReplacerecord componentdirection- the value for thedirectionrecord componentchanceToContinue- the value for thechanceToContinuerecord componentcapFeature- the value for thecapFeaturerecord 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
canReplace
Returns the value of thecanReplacerecord component.- Returns:
- the value of the
canReplacerecord component
-
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-
chanceToContinue
public float chanceToContinue()Returns the value of thechanceToContinuerecord component.- Returns:
- the value of the
chanceToContinuerecord component
-
capFeature
Returns the value of thecapFeaturerecord component.- Returns:
- the value of the
capFeaturerecord component
-