Record Class RandomSpreadStructurePlacement
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.structure.placement.RandomSpreadStructurePlacement
- All Implemented Interfaces:
StructurePlacement
public record RandomSpreadStructurePlacement(int spacing, int separation, RandomSpreadType spreadType, int salt, Vec3i locateOffset)
extends Record
implements StructurePlacement
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RandomSpreadStructurePlacement>private final Vec3iThe field for thelocateOffsetrecord component.private final intThe field for thesaltrecord component.private final intThe field for theseparationrecord component.private final intThe field for thespacingrecord component.private final RandomSpreadTypeThe field for thespreadTyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRandomSpreadStructurePlacement(int p_204980_, int p_204981_, RandomSpreadType p_204982_, int p_204983_) RandomSpreadStructurePlacement(int spacing, int separation, RandomSpreadType spreadType, int salt, Vec3i locateOffset) Creates an instance of aRandomSpreadStructurePlacementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.getPotentialFeatureChunk(long p_204992_, int p_204993_, int p_204994_) final inthashCode()Returns a hash code value for this object.booleanisFeatureChunk(ChunkGenerator p_212315_, long p_212316_, int p_212317_, int p_212318_) Returns the value of thelocateOffsetrecord component.intsalt()Returns the value of thesaltrecord component.intReturns the value of theseparationrecord component.intspacing()Returns the value of thespacingrecord component.Returns the value of thespreadTyperecord component.final StringtoString()Returns a string representation of this record class.type()
-
Field Details
-
spacing
private final int spacingThe field for thespacingrecord component. -
separation
private final int separationThe field for theseparationrecord component. -
spreadType
The field for thespreadTyperecord component. -
salt
private final int saltThe field for thesaltrecord component. -
locateOffset
The field for thelocateOffsetrecord component. -
CODEC
-
-
Constructor Details
-
RandomSpreadStructurePlacement
public RandomSpreadStructurePlacement(int p_204980_, int p_204981_, RandomSpreadType p_204982_, int p_204983_) -
RandomSpreadStructurePlacement
public RandomSpreadStructurePlacement(int spacing, int separation, RandomSpreadType spreadType, int salt, Vec3i locateOffset) Creates an instance of aRandomSpreadStructurePlacementrecord class.- Parameters:
spacing- the value for thespacingrecord componentseparation- the value for theseparationrecord componentspreadType- the value for thespreadTyperecord componentsalt- the value for thesaltrecord componentlocateOffset- the value for thelocateOffsetrecord component
-
-
Method Details
-
getPotentialFeatureChunk
-
isFeatureChunk
public boolean isFeatureChunk(ChunkGenerator p_212315_, long p_212316_, int p_212317_, int p_212318_) - Specified by:
isFeatureChunkin interfaceStructurePlacement
-
type
- Specified by:
typein interfaceStructurePlacement
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
spacing
public int spacing()Returns the value of thespacingrecord component.- Returns:
- the value of the
spacingrecord component
-
separation
public int separation()Returns the value of theseparationrecord component.- Returns:
- the value of the
separationrecord component
-
spreadType
Returns the value of thespreadTyperecord component.- Returns:
- the value of the
spreadTyperecord component
-
salt
public int salt()Returns the value of thesaltrecord component.- Returns:
- the value of the
saltrecord component
-
locateOffset
Returns the value of thelocateOffsetrecord component.- Returns:
- the value of the
locateOffsetrecord component
-