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

neoForge {
    neoFormVersion = neo_form_version
    //validateAccessTransformers = true
    // Automatically enable AccessTransformers if the file exists
    def at = file('src/main/resources/META-INF/accesstransformer.cfg')
    if (at.exists()) {
        accessTransformers.from at.absolutePath
    }
    parchment {
        minecraftVersion = parchment_minecraft
        mappingsVersion = parchment_version
    }
}

dependencies {
    compileOnly group: 'net.fabricmc', name: 'sponge-mixin', version: '0.15.3+mixin.0.8.7'

    compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'
    annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5'

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

    api "me.shedaniel.cloth:cloth-config-neoforge:${project.cloth_config_version}"

    implementation "me.fallenbreath:conditional-mixin-neoforge:${project.conditional_mixins_version}"
    implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-common:${project.mixinsquared_version}"))
}

configurations {
    commonJava {
        canBeResolved = false
        canBeConsumed = true
    }
    commonResources {
        canBeResolved = false
        canBeConsumed = true
    }
}

artifacts {
    commonJava sourceSets.main.java.sourceDirectories.singleFile
    commonResources sourceSets.main.resources.sourceDirectories.singleFile
}