Pos2i

@Serializable
@SerialName(value = "pos2i")
data class Pos2i(val x: Int, val z: Int) : Pos2DimensionalConvertible<Int, Pos3i, Pos2i> (source)

A simple class representing a pair of x and z (being 2-dimensional integer coordinates). As y would be the height in Minecraft, this two-dimensional class does not contain a y value.

Constructors

Link copied to clipboard
constructor(x: Int, z: Int)

Properties

Link copied to clipboard
open override val x: Int

Horizontal x-coordinate, equivalent of x in a Minecraft world.

Link copied to clipboard
open override val z: Int

Horizontal z-coordinate, equivalent of z in a Minecraft world. In general maths this would be the y coordinate on a regular 2d plane.

Functions

Link copied to clipboard
open override fun atY(y: Int): Pos3i

Keeps the x and z coordinate, but puts this position into 3-dimensional space (Pos3Dimensional) at the given height y.

Link copied to clipboard
open fun toBlockPos(y: Int): BlockPos
Link copied to clipboard
open fun toMcVec2(): Vec2
Link copied to clipboard
open fun toPair(): Pair<Int, Int>

Converts this position to a basic Kotlin Pair of x and z.