diff options
author | Jacob <admin@kath.lol> | 2025-06-25 17:50:48 +0800 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2025-06-26 16:19:02 +0200 |
commit | 69124551ab0d8537d2abe542c100ac798b727ce6 (patch) | |
tree | 1f0b7ca7c704c5ca4aa30b1f75cb266c80643031 /src | |
parent | 081590e019fe9e2bfc633214ef623e21dce11fb3 (diff) | |
download | Firmament-69124551ab0d8537d2abe542c100ac798b727ce6.tar.gz Firmament-69124551ab0d8537d2abe542c100ac798b727ce6.tar.bz2 Firmament-69124551ab0d8537d2abe542c100ac798b727ce6.zip |
fix: import cw waypoints missing null check
Diffstat (limited to 'src')
-rw-r--r-- | src/main/kotlin/features/world/ColeWeightCompat.kt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/kotlin/features/world/ColeWeightCompat.kt b/src/main/kotlin/features/world/ColeWeightCompat.kt index 4b00c6e..f7f1317 100644 --- a/src/main/kotlin/features/world/ColeWeightCompat.kt +++ b/src/main/kotlin/features/world/ColeWeightCompat.kt @@ -16,9 +16,9 @@ import moe.nea.firmament.util.tr object ColeWeightCompat { @Serializable data class ColeWeightWaypoint( - val x: Int, - val y: Int, - val z: Int, + val x: Int?, + val y: Int?, + val z: Int?, val r: Int = 0, val g: Int = 0, val b: Int = 0, @@ -31,9 +31,9 @@ object ColeWeightCompat { } fun intoFirm(waypoints: List<ColeWeightWaypoint>, relativeTo: BlockPos): FirmWaypoints { - val w = waypoints.map { - FirmWaypoints.Waypoint(it.x + relativeTo.x, it.y + relativeTo.y, it.z + relativeTo.z) - } + val w = waypoints + .filter { it.x != null && it.y != null && it.z != null } + .map { FirmWaypoints.Waypoint(it.x!! + relativeTo.x, it.y!! + relativeTo.y, it.z!! + relativeTo.z) } return FirmWaypoints( "Imported Waypoints", "imported", |