Record Class RandomNeighborSpreadFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.RandomNeighborSpreadFeature
- All Implemented Interfaces:
Feature
public record RandomNeighborSpreadFeature(Holder<BlockStateProvider> block, HolderSet<Block> acceptedNeighbors, BlockPredicate canReplace, IntProvider attempts, IntProvider xzOffset, IntProvider yOffset)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theacceptedNeighborsrecord component.private final IntProviderThe field for theattemptsrecord component.private final Holder<BlockStateProvider> The field for theblockrecord component.private final BlockPredicateThe field for thecanReplacerecord component.static final com.mojang.serialization.MapCodec<RandomNeighborSpreadFeature> private static final Direction[]private final IntProviderThe field for thexzOffsetrecord component.private final IntProviderThe field for theyOffsetrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionRandomNeighborSpreadFeature(Holder<BlockStateProvider> block, HolderSet<Block> acceptedNeighbors, BlockPredicate canReplace, IntProvider attempts, IntProvider xzOffset, IntProvider yOffset) Creates an instance of aRandomNeighborSpreadFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theacceptedNeighborsrecord component.attempts()Returns the value of theattemptsrecord component.block()Returns the value of theblockrecord component.Returns the value of thecanReplacerecord component.com.mojang.serialization.MapCodec<RandomNeighborSpreadFeature> 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) final StringtoString()Returns a string representation of this record class.xzOffset()Returns the value of thexzOffsetrecord component.yOffset()Returns the value of theyOffsetrecord component.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
block
The field for theblockrecord component. -
acceptedNeighbors
-
canReplace
The field for thecanReplacerecord component. -
attempts
The field for theattemptsrecord component. -
xzOffset
The field for thexzOffsetrecord component. -
yOffset
The field for theyOffsetrecord component. -
CODEC
-
DIRECTIONS
-
-
Constructor Details
-
RandomNeighborSpreadFeature
public RandomNeighborSpreadFeature(Holder<BlockStateProvider> block, HolderSet<Block> acceptedNeighbors, BlockPredicate canReplace, IntProvider attempts, IntProvider xzOffset, IntProvider yOffset) Creates an instance of aRandomNeighborSpreadFeaturerecord class.- Parameters:
block- the value for theblockrecord componentacceptedNeighbors- the value for theacceptedNeighborsrecord componentcanReplace- the value for thecanReplacerecord componentattempts- the value for theattemptsrecord componentxzOffset- the value for thexzOffsetrecord componentyOffset- the value for theyOffsetrecord 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). -
block
Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
acceptedNeighbors
-
canReplace
Returns the value of thecanReplacerecord component.- Returns:
- the value of the
canReplacerecord component
-
attempts
Returns the value of theattemptsrecord component.- Returns:
- the value of the
attemptsrecord component
-
xzOffset
Returns the value of thexzOffsetrecord component.- Returns:
- the value of the
xzOffsetrecord component
-
yOffset
Returns the value of theyOffsetrecord component.- Returns:
- the value of the
yOffsetrecord component
-