Record Class BiomePosition

java.lang.Object
java.lang.Record
dev.wyck.misc.BiomePosition
Record Components:
chunkLocation - the containing chunk
quartX - the world quart X
quartY - the world quart Y
quartZ - the world quart Z
localQuartX - the chunk-relative quart X
localQuartY - the column-relative quart Y
localQuartZ - the chunk-relative quart Z

@NullMarked @AsOf("3.3.0") public record BiomePosition(ChunkLocation chunkLocation, int quartX, int quartY, int quartZ, int localQuartX, int localQuartY, int localQuartZ) extends Record
The position of one biome cell in an outgoing chunk packet.

Minecraft stores biomes at quart resolution.

Since:
3.3.0
  • Constructor Summary

    Constructors
    Constructor
    Description
    BiomePosition(ChunkLocation chunkLocation, int quartX, int quartY, int quartZ, int localQuartX, int localQuartY, int localQuartZ)
    Creates an instance of a BiomePosition record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the minimum block X represented by this biome cell.
    int
    Gets the minimum block Y represented by this biome cell.
    int
    Gets the minimum block Z represented by this biome cell.
    Returns the value of the chunkLocation record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    fromBlock(ChunkLocation chunkLocation, int minQuartY, int blockX, int blockY, int blockZ)
    Creates the biome-cell position containing the supplied block coordinates.
    fromLocalQuart(ChunkLocation chunkLocation, int minQuartY, int localQuartX, int localQuartY, int localQuartZ)
    Creates a biome-cell position from chunk-relative quart coordinates.
    final int
    Returns a hash code value for this object.
    int
    Gets the minimum chunk-relative block X represented by this biome cell.
    int
    Gets the minimum column-relative block Y represented by this biome cell.
    int
    Gets the minimum chunk-relative block Z represented by this biome cell.
    int
    Returns the value of the localQuartX record component.
    int
    Returns the value of the localQuartY record component.
    int
    Returns the value of the localQuartZ record component.
    int
    Returns the value of the quartX record component.
    int
    Returns the value of the quartY record component.
    int
    Returns the value of the quartZ record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • BiomePosition

      public BiomePosition(ChunkLocation chunkLocation, int quartX, int quartY, int quartZ, int localQuartX, int localQuartY, int localQuartZ)
      Creates an instance of a BiomePosition record class.
      Parameters:
      chunkLocation - the value for the chunkLocation record component
      quartX - the value for the quartX record component
      quartY - the value for the quartY record component
      quartZ - the value for the quartZ record component
      localQuartX - the value for the localQuartX record component
      localQuartY - the value for the localQuartY record component
      localQuartZ - the value for the localQuartZ record component
  • Method Details

    • blockX

      @AsOf("3.3.0") public int blockX()
      Gets the minimum block X represented by this biome cell.
      Returns:
      the minimum block X
      Since:
      3.3.0
    • blockY

      @AsOf("3.3.0") public int blockY()
      Gets the minimum block Y represented by this biome cell.
      Returns:
      the minimum block Y
      Since:
      3.3.0
    • blockZ

      @AsOf("3.3.0") public int blockZ()
      Gets the minimum block Z represented by this biome cell.
      Returns:
      the minimum block Z
      Since:
      3.3.0
    • localBlockX

      @AsOf("3.3.0") public int localBlockX()
      Gets the minimum chunk-relative block X represented by this biome cell.
      Returns:
      the minimum chunk-relative block X
      Since:
      3.3.0
    • localBlockY

      @AsOf("3.3.0") public int localBlockY()
      Gets the minimum column-relative block Y represented by this biome cell.
      Returns:
      the minimum column-relative block Y
      Since:
      3.3.0
    • localBlockZ

      @AsOf("3.3.0") public int localBlockZ()
      Gets the minimum chunk-relative block Z represented by this biome cell.
      Returns:
      the minimum chunk-relative block Z
      Since:
      3.3.0
    • fromLocalQuart

      @AsOf("3.3.0") public static BiomePosition fromLocalQuart(ChunkLocation chunkLocation, int minQuartY, int localQuartX, int localQuartY, int localQuartZ)
      Creates a biome-cell position from chunk-relative quart coordinates.
      Parameters:
      chunkLocation - the containing chunk
      minQuartY - the world's minimum build height in quart coordinates
      localQuartX - the chunk-relative quart X
      localQuartY - the column-relative quart Y
      localQuartZ - the chunk-relative quart Z
      Returns:
      the biome-cell position
      Since:
      3.3.0
    • fromBlock

      @AsOf("3.3.0") public static BiomePosition fromBlock(ChunkLocation chunkLocation, int minQuartY, int blockX, int blockY, int blockZ)
      Creates the biome-cell position containing the supplied block coordinates.
      Parameters:
      chunkLocation - the containing chunk
      minQuartY - the world's minimum build height in quart coordinates
      blockX - the world block X
      blockY - the world block Y
      blockZ - the world block Z
      Returns:
      the containing biome-cell position
      Since:
      3.3.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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • chunkLocation

      public ChunkLocation chunkLocation()
      Returns the value of the chunkLocation record component.
      Returns:
      the value of the chunkLocation record component
    • quartX

      public int quartX()
      Returns the value of the quartX record component.
      Returns:
      the value of the quartX record component
    • quartY

      public int quartY()
      Returns the value of the quartY record component.
      Returns:
      the value of the quartY record component
    • quartZ

      public int quartZ()
      Returns the value of the quartZ record component.
      Returns:
      the value of the quartZ record component
    • localQuartX

      public int localQuartX()
      Returns the value of the localQuartX record component.
      Returns:
      the value of the localQuartX record component
    • localQuartY

      public int localQuartY()
      Returns the value of the localQuartY record component.
      Returns:
      the value of the localQuartY record component
    • localQuartZ

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