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