Record Class BiomePosition
java.lang.Object
java.lang.Record
dev.wyck.misc.BiomePosition
- Record Components:
chunkLocation- the containing chunkquartX- the world quart XquartY- the world quart YquartZ- the world quart ZlocalQuartX- the chunk-relative quart XlocalQuartY- the column-relative quart YlocalQuartZ- 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
ConstructorsConstructorDescriptionBiomePosition(ChunkLocation chunkLocation, int quartX, int quartY, int quartZ, int localQuartX, int localQuartY, int localQuartZ) Creates an instance of aBiomePositionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintblockX()Gets the minimum block X represented by this biome cell.intblockY()Gets the minimum block Y represented by this biome cell.intblockZ()Gets the minimum block Z represented by this biome cell.Returns the value of thechunkLocationrecord component.final booleanIndicates whether some other object is "equal to" this one.static BiomePositionfromBlock(ChunkLocation chunkLocation, int minQuartY, int blockX, int blockY, int blockZ) Creates the biome-cell position containing the supplied block coordinates.static BiomePositionfromLocalQuart(ChunkLocation chunkLocation, int minQuartY, int localQuartX, int localQuartY, int localQuartZ) Creates a biome-cell position from chunk-relative quart coordinates.final inthashCode()Returns a hash code value for this object.intGets the minimum chunk-relative block X represented by this biome cell.intGets the minimum column-relative block Y represented by this biome cell.intGets the minimum chunk-relative block Z represented by this biome cell.intReturns the value of thelocalQuartXrecord component.intReturns the value of thelocalQuartYrecord component.intReturns the value of thelocalQuartZrecord component.intquartX()Returns the value of thequartXrecord component.intquartY()Returns the value of thequartYrecord component.intquartZ()Returns the value of thequartZrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BiomePosition
public BiomePosition(ChunkLocation chunkLocation, int quartX, int quartY, int quartZ, int localQuartX, int localQuartY, int localQuartZ) Creates an instance of aBiomePositionrecord class.- Parameters:
chunkLocation- the value for thechunkLocationrecord componentquartX- the value for thequartXrecord componentquartY- the value for thequartYrecord componentquartZ- the value for thequartZrecord componentlocalQuartX- the value for thelocalQuartXrecord componentlocalQuartY- the value for thelocalQuartYrecord componentlocalQuartZ- the value for thelocalQuartZrecord component
-
-
Method Details
-
blockX
Gets the minimum block X represented by this biome cell.- Returns:
- the minimum block X
- Since:
- 3.3.0
-
blockY
Gets the minimum block Y represented by this biome cell.- Returns:
- the minimum block Y
- Since:
- 3.3.0
-
blockZ
Gets the minimum block Z represented by this biome cell.- Returns:
- the minimum block Z
- Since:
- 3.3.0
-
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
Gets the minimum column-relative block Y represented by this biome cell.- Returns:
- the minimum column-relative block Y
- Since:
- 3.3.0
-
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 chunkminQuartY- the world's minimum build height in quart coordinateslocalQuartX- the chunk-relative quart XlocalQuartY- the column-relative quart YlocalQuartZ- 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 chunkminQuartY- the world's minimum build height in quart coordinatesblockX- the world block XblockY- the world block YblockZ- the world block Z- Returns:
- the containing biome-cell position
- Since:
- 3.3.0
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
chunkLocation
Returns the value of thechunkLocationrecord component.- Returns:
- the value of the
chunkLocationrecord component
-
quartX
-
quartY
-
quartZ
-
localQuartX
public int localQuartX()Returns the value of thelocalQuartXrecord component.- Returns:
- the value of the
localQuartXrecord component
-
localQuartY
public int localQuartY()Returns the value of thelocalQuartYrecord component.- Returns:
- the value of the
localQuartYrecord component
-
localQuartZ
public int localQuartZ()Returns the value of thelocalQuartZrecord component.- Returns:
- the value of the
localQuartZrecord component
-