apply plugin: 'fabric-loom'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'com.modrinth.minotaur'

apply from: "https://raw.githubusercontent.com/henkelmax/mod-gradle-scripts/${mod_gradle_script_version}/mod.gradle"

processResources {
    filesMatching('fabric.mod.json') {
        expand 'java_version': java_version,
                'version': mod_version,
                'minecraft_version': minecraft_version,
                'min_minecraft_version': min_minecraft_version
    }
}

repositories {
    maven {
        name = "Terraformers"
        url = "https://maven.terraformersmc.com/"
    }
    maven {
        url "https://maven.shedaniel.me/"
    }
    maven {
        name "KvotheShaed Releases"
        url "https://maven.kvotheshaed.ru/releases"
    }
}

dependencies {
    include modImplementation("me.lucko:fabric-permissions-api:${fabric_permissions_api_version}")

    modImplementation "com.terraformersmc:modmenu:${modmenu_version}"

    modApi("me.shedaniel.cloth:cloth-config-fabric:${cloth_config_version}") {
        exclude(group: "net.fabricmc.fabric-api")
    }

    shadow implementation("org.openpnp:opencv:${opencv_version}")

    shadow implementation("ru.dimaskama:javah264:${javah264_version}")

    modCompileOnly("maven.modrinth:iris:${iris_version}-fabric")

    modCompileOnly("maven.modrinth:flashback:${flashback_version}")
    modCompileOnly("maven.modrinth:replaymod:${replaymod_version}")
}

loom {
    mixin {
        add("main")
    }
}

shadowJar {
    // Exclude 32-bit binaries
    exclude("**/x86_32/**")
    exclude("**/ARMv7/**")
    exclude("**/*-x86/**")
}
