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

architectury {
    minecraft = rootProject.minecraft_version
}

subprojects {
    apply plugin: "dev.architectury.loom"
    apply plugin: "com.github.johnrengelman.shadow"

    loom {
        silentMojangMappingsLicense()
    }

    dependencies {
        minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"

        mappings loom.layered() {

            it.parchment("org.parchmentmc.data:parchment-${rootProject.parchment_version}")
            it.officialMojangMappings {
                setNameSyntheticMembers(false)
            }
        }
    }
}

allprojects {
    apply plugin: "java"
    apply plugin: "architectury-plugin"
    apply plugin: "maven-publish"

    archivesBaseName = rootProject.mod_id
    version = rootProject.mod_version
    group = rootProject.maven_group

    repositories {

        flatDir {
            dirs 'mods'
        }

        mavenLocal()

        maven { url "https://maven.parchmentmc.org" }

        maven {
            url = "https://www.cursemaven.com"
            allowInsecureProtocol = true
        }

    }

    tasks.withType(JavaCompile) {
        options.encoding = "UTF-8"
        options.release = 17
    }

    java {
        withSourcesJar()
    }
}
