Record Class BlockColumnFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.BlockColumnFeature
- All Implemented Interfaces:
Feature
public record BlockColumnFeature(List<BlockColumnFeature.Layer> layers, Direction direction, BlockPredicate allowedPlacement, boolean prioritizeTip)
extends Record
implements Feature
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BlockPredicateThe field for theallowedPlacementrecord component.static final com.mojang.serialization.MapCodec<BlockColumnFeature> private final DirectionThe field for thedirectionrecord component.private final List<BlockColumnFeature.Layer> The field for thelayersrecord component.private final booleanThe field for theprioritizeTiprecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionBlockColumnFeature(List<BlockColumnFeature.Layer> layers, Direction direction, BlockPredicate allowedPlacement, boolean prioritizeTip) Creates an instance of aBlockColumnFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theallowedPlacementrecord component.com.mojang.serialization.MapCodec<BlockColumnFeature> codec()Returns the value of thedirectionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static BlockColumnFeature.Layerlayer(IntProvider height, Holder<BlockStateProvider> state) static BlockColumnFeature.Layerlayer(IntProvider height, BlockStateProvider state) layers()Returns the value of thelayersrecord component.booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) booleanReturns the value of theprioritizeTiprecord component.static BlockColumnFeaturesimple(IntProvider height, BlockStateProvider state) final StringtoString()Returns a string representation of this record class.private static voidtruncate(int[] layerHeights, int totalHeight, int newHeight, boolean prioritizeTip) Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
layers
The field for thelayersrecord component. -
direction
The field for thedirectionrecord component. -
allowedPlacement
The field for theallowedPlacementrecord component. -
prioritizeTip
private final boolean prioritizeTipThe field for theprioritizeTiprecord component. -
CODEC
-
-
Constructor Details
-
BlockColumnFeature
public BlockColumnFeature(List<BlockColumnFeature.Layer> layers, Direction direction, BlockPredicate allowedPlacement, boolean prioritizeTip) Creates an instance of aBlockColumnFeaturerecord class.- Parameters:
layers- the value for thelayersrecord componentdirection- the value for thedirectionrecord componentallowedPlacement- the value for theallowedPlacementrecord componentprioritizeTip- the value for theprioritizeTiprecord component
-
-
Method Details
-
layer
-
layer
-
simple
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
truncate
private static void truncate(int[] layerHeights, int totalHeight, int newHeight, boolean prioritizeTip) -
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. -
layers
Returns the value of thelayersrecord component.- Returns:
- the value of the
layersrecord component
-
direction
Returns the value of thedirectionrecord component.- Returns:
- the value of the
directionrecord component
-
allowedPlacement
Returns the value of theallowedPlacementrecord component.- Returns:
- the value of the
allowedPlacementrecord component
-
prioritizeTip
public boolean prioritizeTip()Returns the value of theprioritizeTiprecord component.- Returns:
- the value of the
prioritizeTiprecord component
-