Record Class PolarChunk

java.lang.Object
java.lang.Record
net.hollowcube.polar.PolarChunk

public record PolarChunk(int x, int z, PolarSection[] sections, List<PolarChunk.BlockEntity> blockEntities, int[][] heightmaps, byte[] userData) extends Record
A Java type representing the latest version of the chunk format.
  • Field Details

    • HEIGHTMAP_NONE

      public static final int HEIGHTMAP_NONE
      See Also:
    • HEIGHTMAP_MOTION_BLOCKING

      public static final int HEIGHTMAP_MOTION_BLOCKING
      See Also:
    • HEIGHTMAP_MOTION_BLOCKING_NO_LEAVES

      public static final int HEIGHTMAP_MOTION_BLOCKING_NO_LEAVES
      See Also:
    • HEIGHTMAP_OCEAN_FLOOR

      public static final int HEIGHTMAP_OCEAN_FLOOR
      See Also:
    • HEIGHTMAP_OCEAN_FLOOR_WG

      public static final int HEIGHTMAP_OCEAN_FLOOR_WG
      See Also:
    • HEIGHTMAP_WORLD_SURFACE

      public static final int HEIGHTMAP_WORLD_SURFACE
      See Also:
    • HEIGHTMAP_WORLD_SURFACE_WG

      public static final int HEIGHTMAP_WORLD_SURFACE_WG
      See Also:
  • Constructor Details

    • PolarChunk

      public PolarChunk(int x, int z, PolarSection[] sections, List<PolarChunk.BlockEntity> blockEntities, int[][] heightmaps, byte[] userData)
      Creates an instance of a PolarChunk record class.
      Parameters:
      x - the value for the x record component
      z - the value for the z record component
      sections - the value for the sections record component
      blockEntities - the value for the blockEntities record component
      heightmaps - the value for the heightmaps record component
      userData - the value for the userData record component
  • Method Details

    • heightmap

      public int @Nullable [] heightmap(int type)
    • 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.
    • x

      public int x()
      Returns the value of the x record component.
      Returns:
      the value of the x record component
    • z

      public int z()
      Returns the value of the z record component.
      Returns:
      the value of the z record component
    • sections

      public PolarSection[] sections()
      Returns the value of the sections record component.
      Returns:
      the value of the sections record component
    • blockEntities

      public List<PolarChunk.BlockEntity> blockEntities()
      Returns the value of the blockEntities record component.
      Returns:
      the value of the blockEntities record component
    • heightmaps

      public int[][] heightmaps()
      Returns the value of the heightmaps record component.
      Returns:
      the value of the heightmaps record component
    • userData

      public byte[] userData()
      Returns the value of the userData record component.
      Returns:
      the value of the userData record component