Package net.hollowcube.polar
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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final int -
Constructor Summary
ConstructorsConstructorDescriptionPolarChunk(int x, int z, PolarSection[] sections, List<PolarChunk.BlockEntity> blockEntities, int[][] heightmaps, byte[] userData) Creates an instance of aPolarChunkrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theblockEntitiesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.int @Nullable []heightmap(int type) int[][]Returns the value of theheightmapsrecord component.sections()Returns the value of thesectionsrecord component.final StringtoString()Returns a string representation of this record class.byte[]userData()Returns the value of theuserDatarecord component.intx()Returns the value of thexrecord component.intz()Returns the value of thezrecord component.
-
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 aPolarChunkrecord class.- Parameters:
x- the value for thexrecord componentz- the value for thezrecord componentsections- the value for thesectionsrecord componentblockEntities- the value for theblockEntitiesrecord componentheightmaps- the value for theheightmapsrecord componentuserData- the value for theuserDatarecord component
-
-
Method Details
-
heightmap
public int @Nullable [] heightmap(int type) -
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 '=='. -
x
public int x()Returns the value of thexrecord component.- Returns:
- the value of the
xrecord component
-
z
public int z()Returns the value of thezrecord component.- Returns:
- the value of the
zrecord component
-
sections
Returns the value of thesectionsrecord component.- Returns:
- the value of the
sectionsrecord component
-
blockEntities
Returns the value of theblockEntitiesrecord component.- Returns:
- the value of the
blockEntitiesrecord component
-
heightmaps
public int[][] heightmaps()Returns the value of theheightmapsrecord component.- Returns:
- the value of the
heightmapsrecord component
-
userData
public byte[] userData()Returns the value of theuserDatarecord component.- Returns:
- the value of the
userDatarecord component
-