plugins {
    java
}

group = "com.buildkillreign"
version = "2.0.0"

repositories {
    mavenCentral()
    maven("https://repo.codemc.io/repository/maven-public/") // ✅ CodeMC repository
    maven("https://repo.papermc.io/repository/maven-public/") // ✅ PaperMC repository
}

dependencies {
    compileOnly("com.comphenix.protocol:ProtocolLib:5.1.0") // ✅ Get ProtocolLib from CodeMC
    compileOnly("io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT") // ✅ Get Paper API from PaperMC repo
    compileOnly("io.papermc:paperlib:1.0.5") // ✅ Get PaperLib from CodeMC
}

java {
    toolchain.languageVersion.set(JavaLanguageVersion.of(17)) // Required for MC 1.20+
}

tasks.jar {
    archiveFileName.set("BuildKillReign.jar")
    destinationDirectory.set(file("build/libs"))

    from("src/main/resources") {
        include("plugin.yml")
    }
}
