Record Class HeightRangePlacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.placement.HeightRangePlacement
- All Implemented Interfaces:
PlacementModifier
public record HeightRangePlacement(HeightProvider height)
extends Record
implements PlacementModifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<HeightRangePlacement> private final HeightProviderThe field for theheightrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionHeightRangePlacement(HeightProvider height) Creates an instance of aHeightRangePlacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<HeightRangePlacement> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.height()Returns the value of theheightrecord component.voidmodify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) static HeightRangePlacementof(HeightProvider height) final StringtoString()Returns a string representation of this record class.static HeightRangePlacementtriangle(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) static HeightRangePlacementuniform(VerticalAnchor minInclusive, VerticalAnchor maxInclusive)
-
Field Details
-
height
The field for theheightrecord component. -
CODEC
-
-
Constructor Details
-
HeightRangePlacement
Creates an instance of aHeightRangePlacementrecord class.- Parameters:
height- the value for theheightrecord component
-
-
Method Details
-
of
-
uniform
public static HeightRangePlacement uniform(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) -
triangle
public static HeightRangePlacement triangle(VerticalAnchor minInclusive, VerticalAnchor maxInclusive) -
modify
public void modify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) - Specified by:
modifyin interfacePlacementModifier
-
codec
- Specified by:
codecin interfacePlacementModifier
-
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). -
height
Returns the value of theheightrecord component.- Returns:
- the value of the
heightrecord component
-