2023-04-12 19:14:44 +03:00
|
|
|
import com.modrinth.minotaur.dependencies.DependencyType
|
|
|
|
import com.modrinth.minotaur.dependencies.ModDependency
|
2023-04-18 18:29:57 +03:00
|
|
|
import org.gradle.configurationcache.extensions.capitalized
|
2023-04-12 19:14:44 +03:00
|
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
2023-04-18 18:29:57 +03:00
|
|
|
import xyz.deftu.gradle.tools.minecraft.CurseRelation
|
|
|
|
import xyz.deftu.gradle.tools.minecraft.CurseRelationType
|
2023-04-12 19:14:44 +03:00
|
|
|
|
|
|
|
plugins {
|
|
|
|
java
|
|
|
|
kotlin("jvm")
|
|
|
|
id("xyz.deftu.gradle.multiversion")
|
|
|
|
id("xyz.deftu.gradle.tools")
|
|
|
|
id("xyz.deftu.gradle.tools.minecraft.loom")
|
|
|
|
id("xyz.deftu.gradle.tools.shadow")
|
|
|
|
id("xyz.deftu.gradle.tools.minecraft.releases")
|
|
|
|
}
|
|
|
|
|
|
|
|
val bundle by configurations.creating {
|
|
|
|
if (mcData.isFabric) {
|
|
|
|
configurations.getByName("include").extendsFrom(this)
|
|
|
|
} else configurations.getByName("shade").extendsFrom(this)
|
|
|
|
}
|
|
|
|
|
2023-06-06 10:58:38 +03:00
|
|
|
toolkitLoomHelper {
|
2023-04-12 19:14:44 +03:00
|
|
|
if (mcData.isForge) {
|
|
|
|
useForgeMixin("e4mc_minecraft.mixins.json", true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-06 10:58:38 +03:00
|
|
|
java {
|
|
|
|
withSourcesJar()
|
|
|
|
}
|
|
|
|
|
|
|
|
toolkitReleases {
|
2023-04-18 18:29:57 +03:00
|
|
|
gameVersions.set(when (mcData.version) {
|
|
|
|
11904 -> listOf("1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4")
|
|
|
|
11802 -> listOf("1.17", "1.17.1", "1.18", "1.18.1", "1.18.2")
|
|
|
|
else -> listOf()
|
|
|
|
})
|
|
|
|
releaseName.set("[${when (mcData.version) {
|
|
|
|
11904 -> "1.19-"
|
|
|
|
11802 -> "1.17-1.18.2"
|
|
|
|
else -> mcData.versionStr
|
|
|
|
}}] [${mcData.loader.name.capitalized()}] ${modData.version}")
|
|
|
|
if (mcData.isFabric) {
|
|
|
|
loaders.set(listOf("fabric", "quilt"))
|
|
|
|
}
|
2023-04-12 19:14:44 +03:00
|
|
|
modrinth {
|
|
|
|
projectId.set("qANg5Jrr")
|
2023-06-06 10:58:38 +03:00
|
|
|
useSourcesJar.set(true)
|
2023-04-12 19:14:44 +03:00
|
|
|
if (mcData.isFabric) {
|
|
|
|
dependencies.set(
|
|
|
|
listOf(
|
|
|
|
ModDependency("P7dR8mSH", DependencyType.REQUIRED),
|
|
|
|
ModDependency("Ha28R6CL", DependencyType.REQUIRED),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
dependencies.set(
|
|
|
|
listOf(
|
|
|
|
ModDependency("ordsPcFz", DependencyType.REQUIRED),
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2023-04-18 18:29:57 +03:00
|
|
|
curseforge {
|
|
|
|
projectId.set("849519")
|
|
|
|
if (mcData.isFabric) {
|
|
|
|
relations.set(
|
|
|
|
listOf(
|
|
|
|
CurseRelation("fabric-api", CurseRelationType.REQUIRED),
|
|
|
|
CurseRelation("fabric-language-kotlin", CurseRelationType.REQUIRED)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
} else {
|
|
|
|
relations.set(
|
|
|
|
listOf(
|
|
|
|
CurseRelation("kotlin-for-forge", CurseRelationType.REQUIRED)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2023-04-12 19:14:44 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
maven("https://maven.terraformersmc.com/")
|
|
|
|
mavenCentral()
|
|
|
|
maven("https://thedarkcolour.github.io/KotlinForForge/")
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation(kotlin("stdlib"))
|
|
|
|
|
|
|
|
if (mcData.isFabric) {
|
|
|
|
modImplementation(
|
|
|
|
"net.fabricmc.fabric-api:fabric-api:${
|
|
|
|
when (mcData.version) {
|
|
|
|
11904 -> "0.78.0+1.19.4"
|
|
|
|
11802 -> "0.76.0+1.18.2"
|
|
|
|
else -> throw IllegalStateException("Invalid MC version: ${mcData.version}")
|
|
|
|
}
|
|
|
|
}"
|
|
|
|
)
|
|
|
|
|
|
|
|
modImplementation("net.fabricmc:fabric-language-kotlin:1.8.6+kotlin.1.7.21")
|
|
|
|
} else if (mcData.isForge) {
|
|
|
|
implementation("thedarkcolour:kotlinforforge:3.8.0")
|
|
|
|
}
|
|
|
|
bundle(implementation("org.java-websocket:Java-WebSocket:1.5.3") {
|
|
|
|
exclude(group = "org.slf4j")
|
|
|
|
})
|
|
|
|
}
|