Record Class DiskFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.DiskFeature
- All Implemented Interfaces:
Feature
public record DiskFeature(Holder<BlockStateProvider> stateProvider, BlockPredicate target, IntProvider radius, int halfHeight)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<DiskFeature> private final intThe field for thehalfHeightrecord component.private final IntProviderThe field for theradiusrecord component.private final Holder<BlockStateProvider> The field for thestateProviderrecord component.private final BlockPredicateThe field for thetargetrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionDiskFeature(Holder<BlockStateProvider> stateProvider, BlockPredicate target, IntProvider radius, int halfHeight) Creates an instance of aDiskFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<DiskFeature> codec()final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thehalfHeightrecord component.final inthashCode()Returns a hash code value for this object.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) private booleanplaceColumn(WorldGenLevel level, RandomSource random, int top, int bottom, BlockPos.MutableBlockPos pos) radius()Returns the value of theradiusrecord component.Returns the value of thestateProviderrecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
stateProvider
The field for thestateProviderrecord component. -
target
The field for thetargetrecord component. -
radius
The field for theradiusrecord component. -
halfHeight
private final int halfHeightThe field for thehalfHeightrecord component. -
CODEC
-
-
Constructor Details
-
DiskFeature
public DiskFeature(Holder<BlockStateProvider> stateProvider, BlockPredicate target, IntProvider radius, int halfHeight) Creates an instance of aDiskFeaturerecord class.- Parameters:
stateProvider- the value for thestateProviderrecord componenttarget- the value for thetargetrecord componentradius- the value for theradiusrecord componenthalfHeight- the value for thehalfHeightrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
placeColumn
private boolean placeColumn(WorldGenLevel level, RandomSource random, int top, int bottom, BlockPos.MutableBlockPos pos) -
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. -
stateProvider
Returns the value of thestateProviderrecord component.- Returns:
- the value of the
stateProviderrecord component
-
target
Returns the value of thetargetrecord component.- Returns:
- the value of the
targetrecord component
-
radius
Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
halfHeight
public int halfHeight()Returns the value of thehalfHeightrecord component.- Returns:
- the value of the
halfHeightrecord component
-