Record Class OffsetPlacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.placement.OffsetPlacement
- All Implemented Interfaces:
PlacementModifier
public record OffsetPlacement(IntProvider x, IntProvider y, IntProvider z)
extends Record
implements PlacementModifier
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<OffsetPlacement> private final IntProviderThe field for thexrecord component.private final IntProviderThe field for theyrecord component.private final IntProviderThe field for thezrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionOffsetPlacement(IntProvider x, IntProvider y, IntProvider z) Creates an instance of aOffsetPlacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic OffsetPlacementabove()com.mojang.serialization.MapCodec<OffsetPlacement> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static OffsetPlacementhorizontal(IntProvider xzSpread) voidmodify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output) static OffsetPlacementof(int x, int y, int z) static OffsetPlacementstatic OffsetPlacementof(IntProvider xzSpread, IntProvider ySpread) static OffsetPlacementofTriangle(int xzRange, int yRange) final StringtoString()Returns a string representation of this record class.static OffsetPlacementvertical(IntProvider ySpread) x()Returns the value of thexrecord component.y()Returns the value of theyrecord component.z()Returns the value of thezrecord component.
-
Field Details
-
x
The field for thexrecord component. -
y
The field for theyrecord component. -
z
The field for thezrecord component. -
CODEC
-
-
Constructor Details
-
OffsetPlacement
Creates an instance of aOffsetPlacementrecord class.- Parameters:
x- the value for thexrecord componenty- the value for theyrecord componentz- the value for thezrecord component
-
-
Method Details
-
of
-
ofTriangle
-
vertical
-
horizontal
-
of
-
of
-
above
-
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). -
x
Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
y
Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
z
Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-