diff --git a/build.gradle.kts b/build.gradle.kts index a1a577a4..54f481e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,7 @@ import io.papermc.paperweight.userdev.ReobfArtifactConfiguration +import io.papermc.paperweight.util.path import net.minecrell.pluginyml.bukkit.BukkitPluginDescription +import net.minecrell.pluginyml.paper.PaperPluginDescription /* * This file was generated by the Gradle 'init' task. @@ -8,9 +10,9 @@ import net.minecrell.pluginyml.bukkit.BukkitPluginDescription plugins { java `maven-publish` + id("net.minecrell.plugin-yml.paper") version "0.6.0" // Generates plugin.yml id("io.papermc.paperweight.userdev") version "1.7.1" id("xyz.jpenilla.run-paper") version "2.0.1" // Adds runServer and runMojangMappedServer tasks for testing - id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Generates plugin.yml id("io.github.goooler.shadow") version "8.1.7" // Shadow PluginBase } @@ -123,36 +125,52 @@ dependencies { group = "xyz.nifeather.morph" version = "${project.property("project_version")}" -description = "A morph plugin that aims to provide many features out-of-the-box" +description = "Yet another disguise plugin, that introduces the morph feature to the server, similar to the MetaMorph mod" java.sourceCompatibility = JavaVersion.VERSION_21 -bukkit { +paper { load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD main = "xyz.nifeather.morph.MorphPlugin" - apiVersion = "1.19" + apiVersion = "1.21" authors = listOf("MATRIX-feather") - depend = listOf() - softDepend = listOf("Towny", "Residence", "ModelEngine", "PlaceholderAPI") - version = "${project.property("project_version")}" - prefix = "FeatherMorph" - name = "FeatherMorph" - foliaSupported = true - commands { - register("morph") - register("morphplayer") - register("unmorph") + serverDependencies { + register("ProtocolLib") { + load = PaperPluginDescription.RelativeLoadOrder.BEFORE + required = false + joinClasspath = true + } - register("request") + register("Residence") { + load = PaperPluginDescription.RelativeLoadOrder.BEFORE + required = false + joinClasspath = true + } - register("play-action") + register("ModelEngine") { + load = PaperPluginDescription.RelativeLoadOrder.BEFORE + required = false + joinClasspath = true + } - register("toggle-town-morph-flight") + register("PlaceholderAPI") { + load = PaperPluginDescription.RelativeLoadOrder.BEFORE + required = false + joinClasspath = true + } - val featherMorphCommand = register("feathermorph").get() - featherMorphCommand.aliases = listOf("fm"); + register("Towny") { + load = PaperPluginDescription.RelativeLoadOrder.BEFORE + required = false + joinClasspath = true + } } + version = "${project.property("project_version")}" + prefix = "FeatherMorph" + name = "FeatherMorph" + foliaSupported = true + val permissionRoot = "feathermorph." permissions { @@ -165,9 +183,13 @@ bukkit { register(permissionRoot + "mirror") register(permissionRoot + "chatoverride") - register(permissionRoot + "request.send") - register(permissionRoot + "request.accept") - register(permissionRoot + "request.deny") + register(permissionRoot + "request") { + childrenMap = mapOf( + (permissionRoot + "request.send") to true, + (permissionRoot + "request.accept") to true, + (permissionRoot + "request.deny") to true + ) + } register(permissionRoot + "can_fly") register(permissionRoot + "toggle_town_fly") @@ -224,6 +246,14 @@ java { tasks.build { dependsOn(tasks.shadowJar) + + doLast { + var file = layout.buildDirectory.file("libs/FeatherMorph-${project.property("project_version")}.jar") + + System.out.println("Will delete '${file.path}' to prevent anyone use the wrong jar.") + + delete(file) + } } tasks.shadowJar { @@ -235,6 +265,11 @@ tasks.shadowJar { relocate("de.themoep.inventorygui", "xyz.nifeather.morph.shaded.inventorygui") } +// https://stackoverflow.com/a/74848372 +tasks.withType { + exclude("plugin.yml") +} + tasks.withType() { options.encoding = "UTF-8" }