Record Class JigsawStructure.MaxDistance

java.lang.Object
java.lang.Record
dev.wyck.worldgen.structure.types.JigsawStructure.MaxDistance
Record Components:
horizontal - the horizontal reach in blocks, from 1 to 128
vertical - the vertical reach in blocks
Enclosing interface:
JigsawStructure

@AsOf("3.4.0") public static record JigsawStructure.MaxDistance(int horizontal, int vertical) extends Record
How far from the start piece a jigsaw structure may place pieces.
Since:
3.4.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The vertical reach vanilla uses when none is given: the full height of a dimension.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MaxDistance(int horizontal, int vertical)
    Creates an instance of a MaxDistance record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the horizontal record component.
    of(int distance)
    Creates a maximum distance that is the same horizontally and vertically, as vanilla's single-number form does.
    of(int horizontal, int vertical)
    Creates a maximum distance.
    final String
    Returns a string representation of this record class.
    int
    Returns the value of the vertical record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_VERTICAL

      @AsOf("3.4.0") public static final int DEFAULT_VERTICAL
      The vertical reach vanilla uses when none is given: the full height of a dimension.
      See Also:
  • Constructor Details

    • MaxDistance

      public MaxDistance(int horizontal, int vertical)
      Creates an instance of a MaxDistance record class.
      Parameters:
      horizontal - the value for the horizontal record component
      vertical - the value for the vertical record component
  • Method Details

    • of

      @AsOf("3.4.0") public static JigsawStructure.MaxDistance of(int distance)
      Creates a maximum distance that is the same horizontally and vertically, as vanilla's single-number form does.
      Parameters:
      distance - the reach in blocks
      Returns:
      the maximum distance
      Since:
      3.4.0
    • of

      @AsOf("3.4.0") public static JigsawStructure.MaxDistance of(int horizontal, int vertical)
      Creates a maximum distance.
      Parameters:
      horizontal - the horizontal reach in blocks
      vertical - the vertical reach in blocks
      Returns:
      the maximum distance
      Since:
      3.4.0
    • 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • horizontal

      public int horizontal()
      Returns the value of the horizontal record component.
      Returns:
      the value of the horizontal record component
    • vertical

      public int vertical()
      Returns the value of the vertical record component.
      Returns:
      the value of the vertical record component