rework some stuff
This commit is contained in:
+67
-20
@@ -1,35 +1,51 @@
|
||||
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"
|
||||
}
|
||||
|
||||
allprojects {
|
||||
group = "com.alttd.playershops"
|
||||
version = "1.0-SNAPSHOT"
|
||||
description = "Player Shop plugin for Altitude."
|
||||
group = "com.alttd.playershops"
|
||||
version = "1.0-SNAPSHOT"
|
||||
description = "Player Shop plugin for Altitude."
|
||||
|
||||
apply<JavaLibraryPlugin>()
|
||||
apply<JavaLibraryPlugin>()
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
withType<Javadoc> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(17))
|
||||
}
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<JavaCompile> {
|
||||
options.encoding = Charsets.UTF_8.name()
|
||||
}
|
||||
|
||||
withType<Javadoc> {
|
||||
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") {
|
||||
@@ -50,11 +66,42 @@ fun gitCommit(): String {
|
||||
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.18"
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user