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 Details

    • spacing

      private final int spacing
      The field for the spacing record component.
    • separation

      private final int separation
      The field for the separation record component.
    • spreadType

      private final RandomSpreadType spreadType
      The field for the spreadType record component.
    • salt

      private final int salt
      The field for the salt record component.
    • locateOffset

      private final Vec3i locateOffset
      The field for the locateOffset record component.
    • CODEC

      public static final com.mojang.serialization.Codec<RandomSpreadStructurePlacement> 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 a RandomSpreadStructurePlacement record class.
      Parameters:
      spacing - the value for the spacing record component
      separation - the value for the separation record component
      spreadType - the value for the spreadType record component
      salt - the value for the salt record component
      locateOffset - the value for the locateOffset record component
  • Method Details

    • getPotentialFeatureChunk

      public ChunkPos getPotentialFeatureChunk(long p_204992_, int p_204993_, int p_204994_)
    • isFeatureChunk

      public boolean isFeatureChunk(ChunkGenerator p_212315_, long p_212316_, int p_212317_, int p_212318_)
      Specified by:
      isFeatureChunk in interface StructurePlacement
    • type

      public StructurePlacementType<?> type()
      Specified by:
      type in interface StructurePlacement
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • spacing

      public int spacing()
      Returns the value of the spacing record component.
      Returns:
      the value of the spacing record component
    • separation

      public int separation()
      Returns the value of the separation record component.
      Returns:
      the value of the separation record component
    • spreadType

      public RandomSpreadType spreadType()
      Returns the value of the spreadType record component.
      Returns:
      the value of the spreadType record component
    • salt

      public int salt()
      Returns the value of the salt record component.
      Returns:
      the value of the salt record component
    • locateOffset

      public Vec3i locateOffset()
      Returns the value of the locateOffset record component.
      Returns:
      the value of the locateOffset record component