Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 0 additions & 62 deletions src/main/kotlin/creator/MinecraftModuleBuilder.kt

This file was deleted.

168 changes: 0 additions & 168 deletions src/main/kotlin/creator/ParchmentStep.kt

This file was deleted.

16 changes: 5 additions & 11 deletions src/main/kotlin/creator/PlatformVersion.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* https://mcdev.io/
*
* Copyright (C) 2025 minecraft-dev
* Copyright (C) 2026 minecraft-dev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
Expand All @@ -18,19 +18,20 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

@file:JvmName("PlatformVersion")

package com.demonwav.mcdev.creator

import com.demonwav.mcdev.platform.PlatformType
import com.demonwav.mcdev.update.PluginUtil
import com.demonwav.mcdev.util.fromJson
import com.demonwav.mcdev.util.loggerForTopLevel
import com.demonwav.mcdev.util.mapFirstNotNull
import com.demonwav.mcdev.util.withSuppressed
import com.github.kittinunf.fuel.core.FuelManager
import com.github.kittinunf.fuel.core.requests.suspendable
import com.github.kittinunf.fuel.coroutines.awaitString
import com.google.gson.Gson
import com.intellij.openapi.diagnostic.Attachment
import com.intellij.openapi.diagnostic.logger
import com.intellij.util.net.JdkProxyProvider
import java.io.IOException
import java.net.Proxy
Expand All @@ -52,12 +53,7 @@ private const val OVH_BASE_URL = "https://versions.denwav.com/versions/"

private val URLS = listOf(CLOUDFLARE_BASE_URL, GITHUB_BASE_URL, OVH_BASE_URL)

val PLATFORM_VERSION_LOGGER = logger<PlatformVersion>()

suspend fun getVersionSelector(type: PlatformType): PlatformVersion {
val versionJson = type.versionJson ?: throw UnsupportedOperationException("Incorrect platform type: $type")
return getVersionJson(versionJson)
}
val PLATFORM_VERSION_LOGGER = loggerForTopLevel()

suspend inline fun <reified T : Any> getVersionJson(path: String): T {
return getVersionJson(path, T::class)
Expand Down Expand Up @@ -112,5 +108,3 @@ fun selectProxy(urlText: String): Proxy? {
}
return null
}

data class PlatformVersion(var versions: List<String>, var selectedIndex: Int)
Loading
Loading