Chunk Location API
A chunk location, represented as (x, z) chunk coordinates. It’s an immutable
record of chunk-space (x, z) coordinates, with helpers for converting to and
from block coordinates and Bukkit chunks.
Construction
Section titled “Construction”of(int, int): Creates aChunkLocationfrom chunk coordinates.fromBlockCoords(int, int): Creates aChunkLocationfrom block coordinates, converting them to the containing chunk.
Comparison
Section titled “Comparison”isChunk(Chunk): Checks whether this location matches the given BukkitChunk.isChunk(int, int): Checks whether this location matches the given chunk coordinates.isWithinRadius(ChunkLocation, int): Returns whether this location falls withinradiuschunks of another.
Transformation
Section titled “Transformation”offset(int, int): Returns a newChunkLocationshifted by the given x/z offsets.offset(ChunkLocation): Returns a newChunkLocationshifted by another location’s coordinates.negate(): Returns a newChunkLocationwith both coordinates negated.
World lookups
Section titled “World lookups”These resolve against a live World and return a CompletableFuture, since the chunk may need to load asynchronously.
toBukkitChunk(World): Resolves this location to a BukkitChunkin the given world.centerBlock(World): Gets the center block of this chunk in the given world.getCenterBiome(World): Gets the biome of this chunk’s center block in the given world.