me.obsilabor.pistonmetakt.data.launchermeta.Version.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.data.launchermeta
import kotlinx.serialization.Serializable
import io.ktor.client.call.*
import io.ktor.client.request.*
import me.obsilabor.pistonmetakt.PistonMetaClient
import me.obsilabor.pistonmetakt.data.pistondata.Downloads
import me.obsilabor.pistonmetakt.data.pistondata.PistonData
@Serializable
data class Version(
val complianceLevel: Int,
val id: String,
val releaseTime: String,
val sha1: String,
val time: String,
val type: String,
val url: String
) {
suspend fun getPistonData(): PistonData {
return PistonMetaClient.ktor.get(url).body()
}
suspend fun getDownloads(): Downloads {
return getPistonData().downloads
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy