2022-10-07 16:03:38 +02:00
|
|
|
package io.gitlab.jfronny.scripts
|
2022-10-06 19:30:52 +02:00
|
|
|
|
|
|
|
import org.gradle.api.Project
|
|
|
|
import org.gradle.api.provider.Property
|
|
|
|
import java.util.*
|
|
|
|
|
|
|
|
interface LomExtension {
|
2023-07-09 16:47:13 +02:00
|
|
|
val yarnBuild: Property<String>
|
2022-10-06 19:30:52 +02:00
|
|
|
|
|
|
|
fun yarn(yarnBuild: String) {
|
2023-07-09 16:47:13 +02:00
|
|
|
this.yarnBuild.set(Objects.requireNonNull(yarnBuild))
|
2022-10-06 19:30:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fun mojmap() {
|
2023-07-09 16:47:13 +02:00
|
|
|
yarnBuild.set(null)
|
2022-10-06 19:30:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
val minecraftVersion: Property<String>
|
2024-03-09 17:48:23 +01:00
|
|
|
val fabricLoaderVersion: Property<String>
|
|
|
|
val neoforgeVersion: Property<String>
|
2022-10-06 19:30:52 +02:00
|
|
|
|
2023-07-09 16:47:13 +02:00
|
|
|
fun check(proj: Project) {
|
|
|
|
yarnBuild.finalizeValue()
|
|
|
|
minecraftVersion.finalizeValue()
|
2024-03-09 17:48:23 +01:00
|
|
|
fabricLoaderVersion.finalizeValue()
|
|
|
|
neoforgeVersion.finalizeValue()
|
|
|
|
require(!(fabricLoaderVersion.isPresent && neoforgeVersion.isPresent)) { "fabricLoaderVersion and forgeVersion are mutually exclusive" }
|
|
|
|
require(fabricLoaderVersion.isPresent || neoforgeVersion.isPresent) { "fabricLoaderVersion or forgeVersion must be set" }
|
2023-07-09 16:47:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
fun copyFrom(ext: LomExtension) {
|
|
|
|
yarnBuild.set(ext.yarnBuild)
|
|
|
|
minecraftVersion.set(ext.minecraftVersion)
|
2024-03-09 17:48:23 +01:00
|
|
|
fabricLoaderVersion.set(ext.fabricLoaderVersion)
|
|
|
|
neoforgeVersion.set(ext.neoforgeVersion)
|
2022-10-06 19:30:52 +02:00
|
|
|
}
|
|
|
|
}
|