CoordinateUtils

Pure math utilities for Minecraft coordinate operations.

No Minecraft dependencies (uses raw ints/doubles) so it can live in src/main/.

Types

Link copied to clipboard
data class BoundingBox(val minX: Int, val minY: Int, val minZ: Int, val maxX: Int, val maxY: Int, val maxZ: Int)

Axis-aligned bounding box with normalized min/max corners.

Functions

Link copied to clipboard
fun calculateDistance(x1: Int, y1: Int, z1: Int, x2: Int, y2: Int, z2: Int): Double

Calculates Euclidean distance between two 3D points.

Link copied to clipboard
fun formatCoordinate(x: Int, y: Int, z: Int): String

Formats three integers as a space-separated coordinate string.

Link copied to clipboard

Returns true if the coordinate string starts with ~ or ^.

Link copied to clipboard

Parses six coordinate strings into a BoundingBox, normalizing min/max.