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

neoForge {
    version = neoforge_version
    validateAccessTransformers = true
    // Automatically enable neoforge AccessTransformers if the file exists
    def at = project(':common').file('src/main/resources/META-INF/accesstransformer.cfg')
    if (at.exists()) {
        accessTransformers.from 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()
        }
        server {
            server()
        }
    }
    mods {
        "${mod_id}" {
            sourceSet sourceSets.main
        }
    }
}

dependencies {
    compileOnly "maven.modrinth:sodium:${project.sodium_version}-neoforge"
    runtimeOnly "me.shedaniel.cloth:cloth-config-neoforge:${project.cloth_config_version}"

    //implementation "maven.modrinth:client-tweaks:${project.clienttweaks_version}+neoforge-${project.minecraft_version}"
    //implementation "maven.modrinth:balm:${project.clienttweaks_version}+neoforge-${project.minecraft_version}"

    implementation(jarJar("me.fallenbreath:conditional-mixin-neoforge:${project.conditional_mixins_version}"))


    compileOnly(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:${project.mixinsquared_version}"))
    implementation(jarJar("com.github.bawnorton.mixinsquared:mixinsquared-neoforge:${project.mixinsquared_version}"))
}

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