ChunkPosition

class ChunkPosition(val worldId: UUID?, val x: Int, val z: Int)(source)

Represents the position of a chunk (x, z, and world).

Why not just use Chunk? Because Chunk contains lots of extra information, and so cannot practically be serialized. Holding references to blocks for extended periods may also prevent chunks from unloading, and increase memory usage.

Constructors

Link copied to clipboard
constructor(asLong: Long)
constructor(world: World?, asLong: Long)
constructor(x: Int, z: Int)
constructor(world: World?, x: Int, z: Int)
constructor(chunk: Chunk)
constructor(location: Location)
constructor(block: Block)
constructor(worldId: UUID?, x: Int, z: Int)

Properties

Link copied to clipboard
val chunk: Chunk?
Link copied to clipboard

Obtaining an instance of a Chunk (eg through block.getChunk()) will often LOAD THE CHUNK ITSELF. Yes, actually. This method does not load the chunk, so it's a safe way to check if a chunk is loaded.

Link copied to clipboard
val world: World?
Link copied to clipboard
Link copied to clipboard
val x: Int
Link copied to clipboard
val z: Int

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String