package moe.nea.firmament.util.collections fun List.lastNotNullOfOrNull(func: (T) -> R?): R? { for (i in indices.reversed()) { return func(this[i]) ?: continue } return null }