import java.io.ByteArrayOutputStream import java.io.FileOutputStream import java.net.URL import net.minecrell.pluginyml.bukkit.BukkitPluginDescription import net.minecrell.pluginyml.paper.PaperPluginDescription plugins { `java-library` `maven-publish` id("xyz.jpenilla.run-paper") version "2.3.0" id("de.eldoria.plugin-yml.paper") version "0.8.0" } dependencies { compileOnly("com.alttd.cosmos:cosmos-api:26.2.build.17-stable") compileOnly("com.alttd.altitudeapi:AltitudeAPI:0.0.3") compileOnly("com.github.decentsoftware-eu:decentholograms:2.8.9") compileOnly("org.jetbrains:annotations:16.0.2") testImplementation("org.powermock:powermock-module-junit4:1.7.4") testImplementation("org.powermock:powermock-api-mockito2:1.7.4") } group = "com.alttd.altitudetag" version = System.getenv("BUILD_NUMBER") ?: "DEV-BUILD" description = "AltitudeTag" publishing { publications { create("mavenJava") { from(components["java"]) } } configure { repositories { maven { name = "maven" url = uri("https://repo.destro.xyz/snapshots/") credentials(PasswordCredentials::class) } } } } tasks { withType { options.encoding = Charsets.UTF_8.name() } withType { options.encoding = Charsets.UTF_8.name() } jar { archiveFileName.set("${rootProject.name}.jar") } runServer { val dir = File(System.getProperty("user.home") + "/share/devserver/") if (!dir.parentFile.exists()) { dir.parentFile.mkdirs() } runDirectory.set(dir) val fileName = "/galaxy.jar" val file = File(dir.path + fileName) if (!file.parentFile.exists()) { file.parentFile.mkdirs() } if (!file.exists()) { download("https://repo.destro.xyz/private/com/alttd/Galaxy-Server/Galaxy-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar", file) } serverJar(file) minecraftVersion("1.20.4") } } fun download(link: String, path: File) { URL(link).openStream().use { input -> FileOutputStream(path).use { output -> input.copyTo(output) } } } paper { name = rootProject.name main = "$group.${rootProject.name}" bootstrapper = "$group.${rootProject.name}Bootstrap" version = "${rootProject.version}" apiVersion = "1.21" authors = listOf("Michael Ziluck", "destro174") serverDependencies { register("DecentHolograms") { load = PaperPluginDescription.RelativeLoadOrder.BEFORE } } permissions { register("tag.play") { description = "Base permission for the ${rootProject.name} plugin." default = BukkitPluginDescription.Permission.Default.FALSE } register("tag.commands.admin") { description = "Admin permission for the ${rootProject.name} plugin." default = BukkitPluginDescription.Permission.Default.FALSE children = listOf( "tag.play" ) } register("tag.commands.admin.location") { description = "Admin permission for setting the scoreboard location." default = BukkitPluginDescription.Permission.Default.FALSE children = listOf( "tag.play", "tag.commands.admin" ) } } }