me.obsilabor.pistonmetakt.utils.VersionUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of piston-meta-kt Show documentation
Show all versions of piston-meta-kt Show documentation
Kotlin library to interact with mojangs launchermeta and "piston-data" api
package me.obsilabor.pistonmetakt.utils
import me.obsilabor.pistonmetakt.PistonMetaClient
import me.obsilabor.pistonmetakt.data.launchermeta.Version
suspend operator fun Version.compareTo(other: Version): Int {
val versions = PistonMetaClient.getLauncherMeta().versions
return when(versions.indexOf(this).compareTo(versions.indexOf(other))) { // invert the result
-1 -> 1
1 -> -1
else -> 0
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy