Record Class RandomlySelectedPlacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.placement.RandomlySelectedPlacement
- All Implemented Interfaces:
PlacementModifier
public record RandomlySelectedPlacement(List<PlacementModifier> placements)
extends Record
implements PlacementModifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<RandomlySelectedPlacement> private final List<PlacementModifier> The field for theplacementsrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRandomlySelectedPlacement(List<PlacementModifier> placements) Creates an instance of aRandomlySelectedPlacementrecord class.RandomlySelectedPlacement(PlacementModifier... placements) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<RandomlySelectedPlacement> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.voidmodify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) Returns the value of theplacementsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
placements
The field for theplacementsrecord component. -
CODEC
-
-
Constructor Details
-
RandomlySelectedPlacement
-
RandomlySelectedPlacement
Creates an instance of aRandomlySelectedPlacementrecord class.- Parameters:
placements- the value for theplacementsrecord component
-
-
Method Details
-
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). -
placements
Returns the value of theplacementsrecord component.- Returns:
- the value of the
placementsrecord component
-