Record Class ReplaceBlobsFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.ReplaceBlobsFeature
- All Implemented Interfaces:
Feature
public record ReplaceBlobsFeature(BlockState targetState, BlockState replaceState, IntProvider radius)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<ReplaceBlobsFeature> private final IntProviderThe field for theradiusrecord component.private final BlockStateThe field for thereplaceStaterecord component.private final BlockStateThe field for thetargetStaterecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionReplaceBlobsFeature(BlockState targetState, BlockState replaceState, IntProvider radius) Creates an instance of aReplaceBlobsFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<ReplaceBlobsFeature> codec()final booleanIndicates whether some other object is "equal to" this one.findTarget(LevelAccessor level, BlockPos.MutableBlockPos cursor, Block target) final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) radius()Returns the value of theradiusrecord component.Returns the value of thereplaceStaterecord component.Returns the value of thetargetStaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
targetState
The field for thetargetStaterecord component. -
replaceState
The field for thereplaceStaterecord component. -
radius
The field for theradiusrecord component. -
CODEC
-
-
Constructor Details
-
ReplaceBlobsFeature
Creates an instance of aReplaceBlobsFeaturerecord class.- Parameters:
targetState- the value for thetargetStaterecord componentreplaceState- the value for thereplaceStaterecord componentradius- the value for theradiusrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
findTarget
private static @Nullable BlockPos findTarget(LevelAccessor level, BlockPos.MutableBlockPos cursor, Block target) -
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). -
targetState
Returns the value of thetargetStaterecord component.- Returns:
- the value of the
targetStaterecord component
-
replaceState
Returns the value of thereplaceStaterecord component.- Returns:
- the value of the
replaceStaterecord component
-
radius
Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-