Pos2f

@Serializable
@SerialName(value = "pos2f")
data class Pos2f(val x: Float, val z: Float) : Pos2DimensionalConvertible<Float, Pos3f, Pos2f> (source)

A simple class representing a pair of x and z (being 2-dimensional floating point 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: Float, z: Float)

Properties

Link copied to clipboard
open override val x: Float

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

Link copied to clipboard
open override val z: Float

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: Float): Pos3f

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: Float): BlockPos
Link copied to clipboard
open fun toMcVec2(): Vec2
Link copied to clipboard
open fun toPair(): Pair<Float, Float>

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