BlockPosition

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

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

Why not just use Block? Because Block contains lots of extra information such as the type of the block, 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(x: Int, y: Int, z: Int)
constructor(world: World?, x: Int, y: Int, z: Int)
constructor(location: Location)
constructor(world: World?, position: Vector)
constructor(block: Block)
constructor(worldId: UUID?, x: Int, y: Int, z: Int)

Properties

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

Functions

Link copied to clipboard
fun addScalar(x: Int, y: Int, z: Int): BlockPosition
Link copied to clipboard
operator fun div(value: Int): BlockPosition
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
operator fun minus(other: BlockPosition): BlockPosition
operator fun minus(other: Vector3i): BlockPosition
Link copied to clipboard
operator fun plus(other: BlockPosition): BlockPosition
operator fun plus(other: Vector3i): BlockPosition
Link copied to clipboard
operator fun times(value: Int): BlockPosition
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard