plugins {
    id 'com.gradleup.shadow' version "${shadow_version}" apply false
    id 'com.modrinth.minotaur' version "${minotaur_version}" apply false
    id 'fabric-loom' version "${fabric_loom_version}" apply false
    id 'io.papermc.paperweight.userdev' version "${paperweight_version}" apply false
    id 'xyz.jpenilla.run-paper' version "${run_task_version}" apply false
    id 'io.papermc.hangar-publish-plugin' version "${hangar_publish_version}" apply false
}

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

tasks.register('publishModsToModrinth') {
    group = 'webcam'
    doLast {
        runGradleTasks(['clean'], ['neoforge:modrinth', 'fabric:modrinth'])
    }
}

tasks.register('publishPluginToModrinth') {
    group = 'webcam'
    doLast {
        runGradleTasks(['clean'], ['paper:modrinth'])
    }
}

tasks.register('publishAllToModrinth') {
    group = 'webcam'
    doLast {
        runGradleTasks(['clean'], ['neoforge:modrinth', 'fabric:modrinth', 'paper:modrinth', 'velocity:modrinth'])
    }
}

tasks.register('publishPluginsToHangar') {
    group = 'webcam'
    doLast {
        runGradleTasks(['clean'], ['paper:publishAllPublicationsToHangar'])
    }
}

tasks.register('publishEverything') {
    group = 'webcam'
    doLast {
        runGradleTasks(['clean'], ['neoforge:modrinth', 'fabric:modrinth', 'paper:modrinth', 'velocity:modrinth', 'paper:publishAllPublicationsToHangar', 'velocity:publishAllPublicationsToHangar'])
    }
}
