fix: import cw waypoints missing null check
This commit is contained in:
@@ -16,9 +16,9 @@ import moe.nea.firmament.util.tr
|
|||||||
object ColeWeightCompat {
|
object ColeWeightCompat {
|
||||||
@Serializable
|
@Serializable
|
||||||
data class ColeWeightWaypoint(
|
data class ColeWeightWaypoint(
|
||||||
val x: Int,
|
val x: Int?,
|
||||||
val y: Int,
|
val y: Int?,
|
||||||
val z: Int,
|
val z: Int?,
|
||||||
val r: Int = 0,
|
val r: Int = 0,
|
||||||
val g: Int = 0,
|
val g: Int = 0,
|
||||||
val b: Int = 0,
|
val b: Int = 0,
|
||||||
@@ -31,9 +31,9 @@ object ColeWeightCompat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun intoFirm(waypoints: List<ColeWeightWaypoint>, relativeTo: BlockPos): FirmWaypoints {
|
fun intoFirm(waypoints: List<ColeWeightWaypoint>, relativeTo: BlockPos): FirmWaypoints {
|
||||||
val w = waypoints.map {
|
val w = waypoints
|
||||||
FirmWaypoints.Waypoint(it.x + relativeTo.x, it.y + relativeTo.y, it.z + relativeTo.z)
|
.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(
|
return FirmWaypoints(
|
||||||
"Imported Waypoints",
|
"Imported Waypoints",
|
||||||
"imported",
|
"imported",
|
||||||
|
|||||||
Reference in New Issue
Block a user