168 lines
5.3 KiB
Plaintext
168 lines
5.3 KiB
Plaintext
import java.io.ByteArrayOutputStream
|
|
import java.io.FileOutputStream
|
|
import java.net.URL
|
|
import net.minecrell.pluginyml.bukkit.BukkitPluginDescription
|
|
|
|
plugins {
|
|
id("java")
|
|
id("java-library")
|
|
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
|
|
id("xyz.jpenilla.run-paper") version "1.0.6"
|
|
id("maven-publish")
|
|
}
|
|
|
|
group = "com.alttd.playershops"
|
|
version = System.getenv("BUILD_NUMBER") ?: "1.3-SNAPSHOT"
|
|
description = "Player Shop plugin for Altitude."
|
|
|
|
apply<JavaLibraryPlugin>()
|
|
apply(plugin = "maven-publish")
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion.set(JavaLanguageVersion.of(21))
|
|
}
|
|
}
|
|
|
|
tasks {
|
|
withType<JavaCompile> {
|
|
options.encoding = Charsets.UTF_8.name()
|
|
}
|
|
|
|
withType<Javadoc> {
|
|
options.encoding = Charsets.UTF_8.name()
|
|
}
|
|
|
|
runServer {
|
|
val fileName = "./run/cosmos.jar"
|
|
val file = File(fileName)
|
|
if (!file.parentFile.exists()) {
|
|
file.parentFile.mkdirs()
|
|
}
|
|
if (!file.exists()) {
|
|
download("https://jenkins.destro.xyz/job/Cosmos/lastSuccessfulBuild/artifact/cosmos-server/build/libs/cosmos-bundler-1.21.6-R0.1-SNAPSHOT-mojmap.jar", fileName)
|
|
}
|
|
serverJar(file)
|
|
minecraftVersion("1.21")
|
|
}
|
|
|
|
jar {
|
|
archiveFileName.set("${rootProject.name}.jar")
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
create<MavenPublication>("mavenJava") {
|
|
from(components["java"])
|
|
}
|
|
}
|
|
|
|
configure<PublishingExtension> {
|
|
repositories {
|
|
maven {
|
|
name = "maven"
|
|
url = uri("https://repo.destro.xyz/snapshots/")
|
|
credentials(PasswordCredentials::class)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly("com.alttd.cosmos:cosmos-api:1.21.6-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.30")
|
|
annotationProcessor("org.projectlombok:lombok:1.18.30")
|
|
}
|
|
|
|
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.20"
|
|
authors = listOf("destro174")
|
|
depend = listOf("Vault")
|
|
softDepend = listOf("GriefPrevention")
|
|
|
|
permissions {
|
|
register("playershops.admin") {
|
|
description = "Admin permission for the ${rootProject.name} plugin."
|
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
|
children = listOf(
|
|
"playershops.shop.create",
|
|
"playershops.shop.break.other",
|
|
"playershops.shop.open.other",
|
|
"playershops.shop.use",
|
|
"playershops.shop.use.buy",
|
|
"playershops.shop.use.sell",
|
|
"playershops.shop.use.random"
|
|
)
|
|
}
|
|
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
|
|
children = listOf(
|
|
"playershops.shop.break",
|
|
)
|
|
}
|
|
register("playershops.shop.open.other") {
|
|
description = "Allows players to open other players shops."
|
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
|
}
|
|
register("playershops.shop.use") {
|
|
description = "Allows players to use all playershops."
|
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
|
children = listOf(
|
|
"playershops.shop.use.buy",
|
|
"playershops.shop.use.sell",
|
|
"playershops.shop.use.random"
|
|
)
|
|
}
|
|
register("playershops.shop.use.buy") {
|
|
description = "Allows players to use buying playershops."
|
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
|
}
|
|
register("playershops.shop.use.sell") {
|
|
description = "Allows players to use selling playershops."
|
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
|
}
|
|
register("playershops.shop.use.random") {
|
|
description = "Allows players to use random playershops."
|
|
default = BukkitPluginDescription.Permission.Default.FALSE
|
|
}
|
|
}
|
|
} |