Record Class CuboidPlacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.CuboidPlacement
- All Implemented Interfaces:
PlacementModifier
public record CuboidPlacement(IntProvider xzSize, IntProvider ySize, boolean includeEdges, boolean includeInterior)
extends Record
implements PlacementModifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<CuboidPlacement> private final booleanThe field for theincludeEdgesrecord component.private final booleanThe field for theincludeInteriorrecord component.private final IntProviderThe field for thexzSizerecord component.private final IntProviderThe field for theySizerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionCuboidPlacement(IntProvider xzSize, IntProvider ySize, boolean includeEdges, boolean includeInterior) Creates an instance of aCuboidPlacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.serialization.MapCodec<CuboidPlacement> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theincludeEdgesrecord component.booleanReturns the value of theincludeInteriorrecord component.voidmodify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) final StringtoString()Returns a string representation of this record class.xzSize()Returns the value of thexzSizerecord component.ySize()Returns the value of theySizerecord component.
-
Field Details
-
xzSize
The field for thexzSizerecord component. -
ySize
The field for theySizerecord component. -
includeEdges
private final boolean includeEdgesThe field for theincludeEdgesrecord component. -
includeInterior
private final boolean includeInteriorThe field for theincludeInteriorrecord component. -
CODEC
-
-
Constructor Details
-
CuboidPlacement
public CuboidPlacement(IntProvider xzSize, IntProvider ySize, boolean includeEdges, boolean includeInterior) Creates an instance of aCuboidPlacementrecord class.- Parameters:
xzSize- the value for thexzSizerecord componentySize- the value for theySizerecord componentincludeEdges- the value for theincludeEdgesrecord componentincludeInterior- the value for theincludeInteriorrecord component
-
-
Method Details
-
codec
- Specified by:
codecin interfacePlacementModifier
-
modify
public void modify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) - Specified by:
modifyin 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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
xzSize
Returns the value of thexzSizerecord component.- Returns:
- the value of the
xzSizerecord component
-
ySize
Returns the value of theySizerecord component.- Returns:
- the value of the
ySizerecord component
-
includeEdges
public boolean includeEdges()Returns the value of theincludeEdgesrecord component.- Returns:
- the value of the
includeEdgesrecord component
-
includeInterior
public boolean includeInterior()Returns the value of theincludeInteriorrecord component.- Returns:
- the value of the
includeInteriorrecord component
-