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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<RandomSpreadStructurePlacement>
private final Vec3i
The field for thelocateOffset
record component.private final int
The field for thesalt
record component.private final int
The field for theseparation
record component.private final int
The field for thespacing
record component.private final RandomSpreadType
The field for thespreadType
record component. -
Constructor Summary
ConstructorDescriptionRandomSpreadStructurePlacement
(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 aRandomSpreadStructurePlacement
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.getPotentialFeatureChunk
(long p_204992_, int p_204993_, int p_204994_) final int
hashCode()
Returns a hash code value for this object.boolean
isFeatureChunk
(ChunkGenerator p_212315_, long p_212316_, int p_212317_, int p_212318_) Returns the value of thelocateOffset
record component.int
salt()
Returns the value of thesalt
record component.int
Returns the value of theseparation
record component.int
spacing()
Returns the value of thespacing
record component.Returns the value of thespreadType
record component.final String
toString()
Returns a string representation of this record class.type()
-
Field Details
-
spacing
private final int spacingThe field for thespacing
record component. -
separation
private final int separationThe field for theseparation
record component. -
spreadType
The field for thespreadType
record component. -
salt
private final int saltThe field for thesalt
record component. -
locateOffset
The field for thelocateOffset
record 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 aRandomSpreadStructurePlacement
record class.- Parameters:
spacing
- the value for thespacing
record componentseparation
- the value for theseparation
record componentspreadType
- the value for thespreadType
record componentsalt
- the value for thesalt
record componentlocateOffset
- the value for thelocateOffset
record component
-
-
Method Details
-
getPotentialFeatureChunk
-
isFeatureChunk
public boolean isFeatureChunk(ChunkGenerator p_212315_, long p_212316_, int p_212317_, int p_212318_) - Specified by:
isFeatureChunk
in interfaceStructurePlacement
-
type
- Specified by:
type
in 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 thespacing
record component.- Returns:
- the value of the
spacing
record component
-
separation
public int separation()Returns the value of theseparation
record component.- Returns:
- the value of the
separation
record component
-
spreadType
Returns the value of thespreadType
record component.- Returns:
- the value of the
spreadType
record component
-
salt
public int salt()Returns the value of thesalt
record component.- Returns:
- the value of the
salt
record component
-
locateOffset
Returns the value of thelocateOffset
record component.- Returns:
- the value of the
locateOffset
record component
-