package io.gitlab.jfronny.scripts import org.gradle.api.Project import org.gradle.api.provider.Property import java.util.* interface LomExtension { val yarnBuild: Property fun yarn(yarnBuild: String) { this.yarnBuild.set(Objects.requireNonNull(yarnBuild)) } fun mojmap() { yarnBuild.set(null) } val minecraftVersion: Property val fabricLoaderVersion: Property val neoforgeVersion: Property fun check(proj: Project) { yarnBuild.finalizeValue() minecraftVersion.finalizeValue() 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" } } fun copyFrom(ext: LomExtension) { yarnBuild.set(ext.yarnBuild) minecraftVersion.set(ext.minecraftVersion) fabricLoaderVersion.set(ext.fabricLoaderVersion) neoforgeVersion.set(ext.neoforgeVersion) } }