import java.io.ByteArrayOutputStream import java.io.FileOutputStream import java.net.URL import net.minecrell.pluginyml.bukkit.BukkitPluginDescription plugins { id("java") id("net.minecrell.plugin-yml.bukkit") version "0.5.1" id("com.github.johnrengelman.shadow") version "7.1.0" id("xyz.jpenilla.run-paper") version "1.0.6" } group = "com.alttd.playershops" version = "1.0-SNAPSHOT" description = "Player Shop plugin for Altitude." apply() java { toolchain { languageVersion.set(JavaLanguageVersion.of(17)) } } tasks { withType { options.encoding = Charsets.UTF_8.name() } withType { options.encoding = Charsets.UTF_8.name() } runServer { val fileName = "./run/galaxy.jar" var file = File(fileName) if (!file.parentFile.exists()) { file.parentFile.mkdirs() } if (!file.exists()) { download("https://repo.destro.xyz/snapshots/com/alttd/Galaxy-Server/Galaxy-paperclip-1.19.2-R0.1-SNAPSHOT-reobf.jar", fileName) } serverJar(file) minecraftVersion("1.19.2") } } dependencies { compileOnly("com.alttd:Galaxy-API:1.18.2-R0.1-SNAPSHOT") compileOnly("com.github.milkbowl:VaultAPI:1.7") { exclude("org.bukkit","bukkit") } compileOnly("com.github.TechFortress:GriefPrevention:16.17.1") compileOnly("org.projectlombok:lombok:1.18.24") annotationProcessor("org.projectlombok:lombok:1.18.24") } fun gitCommit(): String { val os = ByteArrayOutputStream() project.exec { commandLine = "git rev-parse --short HEAD".split(" ") standardOutput = os } return String(os.toByteArray()).trim() } fun download(link: String, path: String) { URL(link).openStream().use { input -> FileOutputStream(File(path)).use { output -> input.copyTo(output) } } } bukkit { name = rootProject.name main = "$group.${rootProject.name}" version = "${rootProject.version}-${gitCommit()}" apiVersion = "1.19" authors = listOf("destro174") depend = listOf("Vault") permissions { register("playershops.admin") { description = "Admin permission for the ${rootProject.name} plugin." default = BukkitPluginDescription.Permission.Default.FALSE } register("playershops.shoplimit") { description = "Base permission to allow per player shop limits." default = BukkitPluginDescription.Permission.Default.FALSE } register("playershops.shop.create") { description = "Allows players to create shops." default = BukkitPluginDescription.Permission.Default.FALSE } register("playershops.shop.break") { description = "Allows players to break shops." default = BukkitPluginDescription.Permission.Default.FALSE } register("playershops.shop.break.other") { description = "Allows players to break other players shops." default = BukkitPluginDescription.Permission.Default.FALSE } } }