plugins {
    id 'java'
}

apply plugin: 'io.papermc.paperweight.userdev'
apply plugin: 'com.gradleup.shadow'
apply plugin: 'com.modrinth.minotaur'
apply plugin: 'io.papermc.hangar-publish-plugin'
apply plugin: 'xyz.jpenilla.run-paper'

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

repositories {
    mavenCentral()

    maven {
        url "https://libraries.minecraft.net"
    }
}

dependencies {
    implementation "io.netty:netty-handler:${netty_version}"
    implementation "io.netty:netty-buffer:${netty_version}"
    implementation "io.netty:netty-transport:${netty_version}"
    implementation "com.mojang:datafixerupper:${datafixerupper_version}"
    implementation "org.joml:joml:${joml_version}"
}

processResources {
    filesMatching('plugin.yml') {
        expand 'version': version
    }
}

tasks {
    runServer {
        minecraftVersion(minecraft_version)
        downloadPlugins {
            modrinth("luckperms", "v${luckperms_version}-bukkit")
        }
    }
}

build.dependsOn(shadowJar)
runServer.dependsOn(build)
