plugins {
    id "architectury-plugin" version "3.4-SNAPSHOT"
    id "dev.architectury.loom" version "1.9-SNAPSHOT" apply false
    id "com.github.johnrengelman.shadow" version "8.1.1" apply false
}

architectury {
    minecraft = project.minecraft_version
}

allprojects {
    group = rootProject.maven_group
}

subprojects {
    apply plugin: "dev.architectury.loom"
    apply plugin: "architectury-plugin"

    base {
        archivesName = rootProject.archives_base_name
    }

    version = "${rootProject.mod_version}+${rootProject.minecraft_version}+${project.name}"

    repositories {
        maven {
            url "https://maven.terraformersmc.com/releases/"
        }
        maven {
            url "https://maven.parchmentmc.org/"
        }
    }

    loom {
        silentMojangMappingsLicense()
    }

    dependencies {
        minecraft "net.minecraft:minecraft:${rootProject.minecraft_version}"
        mappings loom.layered() {
            officialMojangMappings()
            parchment("org.parchmentmc.data:parchment-${rootProject.parchment_minecraft_version}:${rootProject.parchment_version}@zip")
        }
    }

    java {
        sourceCompatibility = JavaVersion.VERSION_21
        targetCompatibility = JavaVersion.VERSION_21
    }

    tasks.withType(JavaCompile).configureEach {
        it.options.release = 21
    }
}
