Record Class BlockBlobFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.BlockBlobFeature
- All Implemented Interfaces:
Feature
public record BlockBlobFeature(BlockState state, BlockPredicate canPlaceOn)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockPredicateThe field for thecanPlaceOnrecord component.static final com.mojang.serialization.MapCodec<BlockBlobFeature> private final BlockStateThe field for thestaterecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionBlockBlobFeature(BlockState state, BlockPredicate canPlaceOn) Creates an instance of aBlockBlobFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecanPlaceOnrecord component.com.mojang.serialization.MapCodec<BlockBlobFeature> 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) state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
state
The field for thestaterecord component. -
canPlaceOn
The field for thecanPlaceOnrecord component. -
CODEC
-
-
Constructor Details
-
BlockBlobFeature
Creates an instance of aBlockBlobFeaturerecord class.- Parameters:
state- the value for thestaterecord componentcanPlaceOn- the value for thecanPlaceOnrecord 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). -
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
canPlaceOn
Returns the value of thecanPlaceOnrecord component.- Returns:
- the value of the
canPlaceOnrecord component
-