plugins {
    id 'multiloader-loader'
    id 'fabric-loom'
}
dependencies {
    minecraft "com.mojang:minecraft:${minecraft_version}"
    mappings loom.layered {
        officialMojangMappings()
        parchment("org.parchmentmc.data:parchment-${parchment_minecraft}:${parchment_version}@zip")
    }
    modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}"
    modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"

    modCompileOnly "maven.modrinth:modmenu:${project.modmenu_version}"
    modCompileOnly "maven.modrinth:sodium:${project.sodium_version}-fabric"
    // ^ Change to `modCompileOnly` to test without sodium
    //modImplementation "maven.modrinth:client-tweaks:${project.clienttweaks_version}+fabric-${project.minecraft_version}"
    //modImplementation "maven.modrinth:balm:${project.clienttweaks_version}+fabric-${project.minecraft_version}"
    // ^ uncomment to test with clienttweaks

    //modImplementation("maven.modrinth:ebe:0.11.3+1.21.4")
    modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
        exclude(group: "net.fabricmc.fabric-api")
    }

    modCompileOnly "maven.modrinth:vulkanmod:${vulkan_version}"

    modImplementation("me.fallenbreath:conditional-mixin-fabric:${project.conditional_mixins_version}")
    include("me.fallenbreath:conditional-mixin-fabric:${project.conditional_mixins_version}")

    include(implementation(annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:${project.mixinsquared_version}")))
}

loom {
    def aw = project(':common').file("src/main/resources/${mod_id}.accesswidener")
    if (aw.exists()) {
        accessWidenerPath.set(aw)
    }
    mixin {
        defaultRefmapName.set("${mod_id}.refmap.json")
    }
    runs {
        client {
            client()
            setConfigName('Fabric Client')
            ideConfigGenerated(true)
            runDir('runs/client')
        }
        server {
            server()
            setConfigName('Fabric Server')
            ideConfigGenerated(true)
            runDir('runs/server')
        }
    }
}