From 9996383aae71a255a18224850f9a97c5d32761f8 Mon Sep 17 00:00:00 2001 From: ohnoey Date: Sun, 11 Aug 2024 07:56:45 -0700 Subject: [PATCH 1/3] Add gradle tasks to run various server versions --- Movecraft/build.gradle.kts | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Movecraft/build.gradle.kts b/Movecraft/build.gradle.kts index 7d261568d..250df0e7f 100644 --- a/Movecraft/build.gradle.kts +++ b/Movecraft/build.gradle.kts @@ -1,12 +1,21 @@ +import xyz.jpenilla.runpaper.task.RunServer + plugins { `maven-publish` id("buildlogic.java-conventions") id("io.github.goooler.shadow") version "8.1.7" id("io.papermc.hangar-publish-plugin") version "0.1.2" + id("xyz.jpenilla.run-paper") version "2.3.0" } java.toolchain.languageVersion = JavaLanguageVersion.of(17) +val supportedMinecraftVersions = listOf( + "1.18.2", + "1.20.6", + "1.21" +) + dependencies { runtimeOnly(project(":movecraft-v1_18", "reobf")) runtimeOnly(project(":movecraft-v1_20", "reobf")) @@ -36,6 +45,23 @@ tasks.processResources { expand(mapOf("projectVersion" to project.version)) } } +tasks { + supportedMinecraftVersions.forEach { serverVersion -> + register("run-$serverVersion") { + minecraftVersion(serverVersion) + jvmArgs("-DPaper.IgnoreJavaVersion=true", "-Dcom.mojang.eula.agree=true") + group = "run paper" + runDirectory.set(file("run-$serverVersion")) + downloadPlugins { + url("https://dev.bukkit.org/projects/worldedit/files/5564367/download") + url("https://ci.lucko.me/job/spark/441/artifact/spark-bukkit/build/libs/spark-1.10.95-bukkit.jar") + hangar("ViaVersion", "5.0.3") + hangar("ViaBackwards", "5.0.3") + } + pluginJars(project.tasks.shadowJar.map { it.archiveFile }.get()) + } + } +} publishing { publications { @@ -68,7 +94,7 @@ hangarPublish { platforms { register(io.papermc.hangarpublishplugin.model.Platforms.PAPER) { jar.set(tasks.shadowJar.flatMap { it.archiveFile }) - platformVersions.set(listOf("1.18.2", "1.20.6", "1.21")) + platformVersions.set(supportedMinecraftVersions) } } } From 9d541f7a92e8991200352a45dd3ca9e8932fb63f Mon Sep 17 00:00:00 2001 From: ohnoey Date: Sun, 11 Aug 2024 08:00:32 -0700 Subject: [PATCH 2/3] Add server to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 07c6b4640..e41426da8 100644 --- a/.gitignore +++ b/.gitignore @@ -197,3 +197,6 @@ gradle-app.setting # datapack output /target-datapack/ + +# test servers +/Movecraft/run-* \ No newline at end of file From ff54b8c5ac1c054233420ad9d0cd8bed55f917f0 Mon Sep 17 00:00:00 2001 From: ohnoey Date: Sun, 11 Aug 2024 08:10:42 -0700 Subject: [PATCH 3/3] Use hangar for worldedit --- Movecraft/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Movecraft/build.gradle.kts b/Movecraft/build.gradle.kts index 250df0e7f..b11a0ca1b 100644 --- a/Movecraft/build.gradle.kts +++ b/Movecraft/build.gradle.kts @@ -53,7 +53,7 @@ tasks { group = "run paper" runDirectory.set(file("run-$serverVersion")) downloadPlugins { - url("https://dev.bukkit.org/projects/worldedit/files/5564367/download") + hangar("WorldEdit", "7.3.6") url("https://ci.lucko.me/job/spark/441/artifact/spark-bukkit/build/libs/spark-1.10.95-bukkit.jar") hangar("ViaVersion", "5.0.3") hangar("ViaBackwards", "5.0.3")