plugins {
    id 'multiloader-loader'
    id 'net.neoforged.moddev'
}

repositories {
    mavenLocal()
    maven {
        name = 'Kotlin for Forge'
        url = 'https://thedarkcolour.github.io/KotlinForForge/'
    }
}

dependencies {
    implementation("thedarkcolour:kotlinforforge-neoforge:${forgelike_adapter_version}")
    implementation("io.ejekta.kambrik:kambrik-neoforge:${kambrik_version}")
}

neoForge {
    version = neoforge_version
    // Automatically enable neoforge AccessTransformers if the file exists
    def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg')
    if (at.exists()) {
        accessTransformers.add(at.absolutePath)
    }
    parchment {
        minecraftVersion = parchment_minecraft
        mappingsVersion = parchment_version
    }
    runs {
        configureEach {
            systemProperty('neoforge.enabledGameTestNamespaces', mod_id)
            ideName = "NeoForge ${it.name.capitalize()} (${project.path})" // Unify the run config names with fabric
        }
        client {
            client()
        }
        data {
            data()
        }
        server {
            server()
        }
    }
    mods {
        "${mod_id}" {
            sourceSet sourceSets.main
        }
    }
}

sourceSets.main.resources { srcDir 'src/generated/resources' }