Record Class SpeleothemClusterFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.SpeleothemClusterFeature
- All Implemented Interfaces:
Feature
public record SpeleothemClusterFeature(BlockState baseBlock, BlockState pointedBlock, HolderSet<Block> replaceableBlocks, int floorToCeilingSearchRange, IntProvider height, IntProvider radius, int maxStalagmiteStalactiteHeightDiff, int heightDeviation, IntProvider speleothemBlockLayerThickness, FloatProvider density, FloatProvider wetness, float chanceOfSpeleothemAtMaxDistanceFromCenter, int maxDistanceFromEdgeAffectingChanceOfSpeleothem, int maxDistanceFromCenterAffectingHeightBias)
extends Record
implements Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockStateThe field for thebaseBlockrecord component.private final floatThe field for thechanceOfSpeleothemAtMaxDistanceFromCenterrecord component.static final com.mojang.serialization.MapCodec<SpeleothemClusterFeature> private final FloatProviderThe field for thedensityrecord component.private final intThe field for thefloorToCeilingSearchRangerecord component.private final IntProviderThe field for theheightrecord component.private final intThe field for theheightDeviationrecord component.private final intThe field for themaxDistanceFromCenterAffectingHeightBiasrecord component.private final intThe field for themaxDistanceFromEdgeAffectingChanceOfSpeleothemrecord component.private final intThe field for themaxStalagmiteStalactiteHeightDiffrecord component.private final BlockStateThe field for thepointedBlockrecord component.private final IntProviderThe field for theradiusrecord component.The field for thereplaceableBlocksrecord component.private final IntProviderThe field for thespeleothemBlockLayerThicknessrecord component.private final FloatProviderThe field for thewetnessrecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionSpeleothemClusterFeature(BlockState baseBlock, BlockState pointedBlock, HolderSet<Block> replaceableBlocks, int floorToCeilingSearchRange, IntProvider height, IntProvider radius, int maxStalagmiteStalactiteHeightDiff, int heightDeviation, IntProvider speleothemBlockLayerThickness, FloatProvider density, FloatProvider wetness, float chanceOfSpeleothemAtMaxDistanceFromCenter, int maxDistanceFromEdgeAffectingChanceOfSpeleothem, int maxDistanceFromCenterAffectingHeightBias) Creates an instance of aSpeleothemClusterFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thebaseBlockrecord component.private booleancanBeAdjacentToWater(LevelAccessor level, BlockPos pos) private booleancanPlacePool(WorldGenLevel level, BlockPos pos) floatReturns the value of thechanceOfSpeleothemAtMaxDistanceFromCenterrecord component.com.mojang.serialization.MapCodec<SpeleothemClusterFeature> codec()density()Returns the value of thedensityrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefloorToCeilingSearchRangerecord component.private doublegetChanceOfStalagmiteOrStalactite(int xRadius, int zRadius, int dx, int dz) private intgetSpeleothemHeight(RandomSource random, int dx, int dz, float density, int maxHeight) final inthashCode()Returns a hash code value for this object.height()Returns the value of theheightrecord component.intReturns the value of theheightDeviationrecord component.private booleanisLava(LevelReader level, BlockPos pos) intReturns the value of themaxDistanceFromCenterAffectingHeightBiasrecord component.intReturns the value of themaxDistanceFromEdgeAffectingChanceOfSpeleothemrecord component.intReturns the value of themaxStalagmiteStalactiteHeightDiffrecord component.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) private voidplaceColumn(WorldGenLevel level, RandomSource random, BlockPos pos, int dx, int dz, float chanceOfWater, double chanceOfStalagmiteOrStalactite, int clusterHeight, float density) Returns the value of thepointedBlockrecord component.radius()Returns the value of theradiusrecord component.private static floatrandomBetweenBiased(RandomSource random, float min, float maxExclusive, float mean, float deviation) Returns the value of thereplaceableBlocksrecord component.private voidreplaceBlocksWithBaseBlocks(WorldGenLevel level, BlockPos firstPos, int maxCount, Direction direction) Returns the value of thespeleothemBlockLayerThicknessrecord component.final StringtoString()Returns a string representation of this record class.wetness()Returns the value of thewetnessrecord component.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
baseBlock
The field for thebaseBlockrecord component. -
pointedBlock
The field for thepointedBlockrecord component. -
replaceableBlocks
-
floorToCeilingSearchRange
private final int floorToCeilingSearchRangeThe field for thefloorToCeilingSearchRangerecord component. -
height
The field for theheightrecord component. -
radius
The field for theradiusrecord component. -
maxStalagmiteStalactiteHeightDiff
private final int maxStalagmiteStalactiteHeightDiffThe field for themaxStalagmiteStalactiteHeightDiffrecord component. -
heightDeviation
private final int heightDeviationThe field for theheightDeviationrecord component. -
speleothemBlockLayerThickness
The field for thespeleothemBlockLayerThicknessrecord component. -
density
The field for thedensityrecord component. -
wetness
The field for thewetnessrecord component. -
chanceOfSpeleothemAtMaxDistanceFromCenter
private final float chanceOfSpeleothemAtMaxDistanceFromCenterThe field for thechanceOfSpeleothemAtMaxDistanceFromCenterrecord component. -
maxDistanceFromEdgeAffectingChanceOfSpeleothem
private final int maxDistanceFromEdgeAffectingChanceOfSpeleothemThe field for themaxDistanceFromEdgeAffectingChanceOfSpeleothemrecord component. -
maxDistanceFromCenterAffectingHeightBias
private final int maxDistanceFromCenterAffectingHeightBiasThe field for themaxDistanceFromCenterAffectingHeightBiasrecord component. -
CODEC
-
-
Constructor Details
-
SpeleothemClusterFeature
public SpeleothemClusterFeature(BlockState baseBlock, BlockState pointedBlock, HolderSet<Block> replaceableBlocks, int floorToCeilingSearchRange, IntProvider height, IntProvider radius, int maxStalagmiteStalactiteHeightDiff, int heightDeviation, IntProvider speleothemBlockLayerThickness, FloatProvider density, FloatProvider wetness, float chanceOfSpeleothemAtMaxDistanceFromCenter, int maxDistanceFromEdgeAffectingChanceOfSpeleothem, int maxDistanceFromCenterAffectingHeightBias) Creates an instance of aSpeleothemClusterFeaturerecord class.- Parameters:
baseBlock- the value for thebaseBlockrecord componentpointedBlock- the value for thepointedBlockrecord componentreplaceableBlocks- the value for thereplaceableBlocksrecord componentfloorToCeilingSearchRange- the value for thefloorToCeilingSearchRangerecord componentheight- the value for theheightrecord componentradius- the value for theradiusrecord componentmaxStalagmiteStalactiteHeightDiff- the value for themaxStalagmiteStalactiteHeightDiffrecord componentheightDeviation- the value for theheightDeviationrecord componentspeleothemBlockLayerThickness- the value for thespeleothemBlockLayerThicknessrecord componentdensity- the value for thedensityrecord componentwetness- the value for thewetnessrecord componentchanceOfSpeleothemAtMaxDistanceFromCenter- the value for thechanceOfSpeleothemAtMaxDistanceFromCenterrecord componentmaxDistanceFromEdgeAffectingChanceOfSpeleothem- the value for themaxDistanceFromEdgeAffectingChanceOfSpeleothemrecord componentmaxDistanceFromCenterAffectingHeightBias- the value for themaxDistanceFromCenterAffectingHeightBiasrecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
placeColumn
private void placeColumn(WorldGenLevel level, RandomSource random, BlockPos pos, int dx, int dz, float chanceOfWater, double chanceOfStalagmiteOrStalactite, int clusterHeight, float density) -
isLava
-
getSpeleothemHeight
-
canPlacePool
-
canBeAdjacentToWater
-
replaceBlocksWithBaseBlocks
private void replaceBlocksWithBaseBlocks(WorldGenLevel level, BlockPos firstPos, int maxCount, Direction direction) -
getChanceOfStalagmiteOrStalactite
private double getChanceOfStalagmiteOrStalactite(int xRadius, int zRadius, int dx, int dz) -
randomBetweenBiased
private static float randomBetweenBiased(RandomSource random, float min, float maxExclusive, float mean, float deviation) -
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. -
baseBlock
Returns the value of thebaseBlockrecord component.- Returns:
- the value of the
baseBlockrecord component
-
pointedBlock
Returns the value of thepointedBlockrecord component.- Returns:
- the value of the
pointedBlockrecord component
-
replaceableBlocks
-
floorToCeilingSearchRange
public int floorToCeilingSearchRange()Returns the value of thefloorToCeilingSearchRangerecord component.- Returns:
- the value of the
floorToCeilingSearchRangerecord component
-
height
Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-
radius
Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
maxStalagmiteStalactiteHeightDiff
public int maxStalagmiteStalactiteHeightDiff()Returns the value of themaxStalagmiteStalactiteHeightDiffrecord component.- Returns:
- the value of the
maxStalagmiteStalactiteHeightDiffrecord component
-
heightDeviation
public int heightDeviation()Returns the value of theheightDeviationrecord component.- Returns:
- the value of the
heightDeviationrecord component
-
speleothemBlockLayerThickness
Returns the value of thespeleothemBlockLayerThicknessrecord component.- Returns:
- the value of the
speleothemBlockLayerThicknessrecord component
-
density
Returns the value of thedensityrecord component.- Returns:
- the value of the
densityrecord component
-
wetness
Returns the value of thewetnessrecord component.- Returns:
- the value of the
wetnessrecord component
-
chanceOfSpeleothemAtMaxDistanceFromCenter
public float chanceOfSpeleothemAtMaxDistanceFromCenter()Returns the value of thechanceOfSpeleothemAtMaxDistanceFromCenterrecord component.- Returns:
- the value of the
chanceOfSpeleothemAtMaxDistanceFromCenterrecord component
-
maxDistanceFromEdgeAffectingChanceOfSpeleothem
public int maxDistanceFromEdgeAffectingChanceOfSpeleothem()Returns the value of themaxDistanceFromEdgeAffectingChanceOfSpeleothemrecord component.- Returns:
- the value of the
maxDistanceFromEdgeAffectingChanceOfSpeleothemrecord component
-
maxDistanceFromCenterAffectingHeightBias
public int maxDistanceFromCenterAffectingHeightBias()Returns the value of themaxDistanceFromCenterAffectingHeightBiasrecord component.- Returns:
- the value of the
maxDistanceFromCenterAffectingHeightBiasrecord component
-