From a97258b9ee4a6ed2acc1f36767886c0ee4f52144 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Sat, 27 Apr 2024 13:27:01 -0700 Subject: [PATCH] Start cleaning up plugin remapping patches --- .../Add-WorldEdit-plugin-flag-test-task.patch | 48 ------------------- patches/server/Build-system-changes.patch | 6 +-- patches/server/Setup-Gradle-project.patch | 5 -- ...oleAppender-for-console-improvements.patch | 27 +++++++---- .../build-replace-use-of-shadow-plugin.patch | 44 ----------------- 5 files changed, 22 insertions(+), 108 deletions(-) delete mode 100644 patches/server/Add-WorldEdit-plugin-flag-test-task.patch delete mode 100644 patches/server/build-replace-use-of-shadow-plugin.patch diff --git a/patches/server/Add-WorldEdit-plugin-flag-test-task.patch b/patches/server/Add-WorldEdit-plugin-flag-test-task.patch deleted file mode 100644 index 99aa44bb55..0000000000 --- a/patches/server/Add-WorldEdit-plugin-flag-test-task.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> -Date: Mon, 12 Feb 2024 22:19:03 -0700 -Subject: [PATCH] Add WorldEdit plugin flag test task - - -diff --git a/build.gradle.kts b/build.gradle.kts -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/build.gradle.kts -+++ b/build.gradle.kts -@@ -0,0 +0,0 @@ - import io.papermc.paperweight.util.* -+import xyz.jpenilla.runpaper.task.RunServer - - plugins { - java - `maven-publish` - id("com.github.johnrengelman.shadow") -+ id("xyz.jpenilla.run-paper") version "2.2.3" apply false - } - - val log4jPlugins = sourceSets.create("log4jPlugins") -@@ -0,0 +0,0 @@ tasks.registerRunTask("runDevServer") { - jvmArgs("-DPaper.pushPaperAssetsRoot=true") - } - -+tasks.register("runWithPlugins") { -+ version.set(providers.gradleProperty("mcVersion")) -+ runJar(rootProject.tasks.named("createMojmapBundlerJar").flatMap { it.outputZip }) -+ downloadPlugins { -+ url("https://ci.enginehub.org/repository/download/bt10/23382:id/worldedit-bukkit-7.2.19-dist.jar?branch=version/7.2.x&guest=1") -+ url("https://www.patreon.com/file?h=89830486&i=15920178") -+ url("https://dev.bukkit.org/projects/grief-prevention/files/4433061/download") -+ github("EssentialsX", "Essentials", "2.20.1", "EssentialsX-2.20.1.jar") -+ hangar("squaremap", "1.2.3") -+ hangar("FancyHolograms", "2.0.5") -+ hangar("Chunky", "1.3.92") -+ hangar("Multiverse-Core", "4.3.12") -+ // Once they fix package parsing -+ // hangar("Denizen", "1.3.0-Build-1803") -+ // hangar("GrimAnticheat", "2.3.58") -+ // hangar("ProtocolLib", "5.1.0") -+ } -+ runDirectory.set(rootProject.layout.projectDirectory.dir("run")) -+} - tasks.registerRunTask("runBundler") { - description = "Spin up a test server from the Mojang mapped bundler jar" - classpath(rootProject.tasks.named("createMojmapBundlerJar").flatMap { it.outputZip }) diff --git a/patches/server/Build-system-changes.patch b/patches/server/Build-system-changes.patch index 74711b410d..dab9856787 100644 --- a/patches/server/Build-system-changes.patch +++ b/patches/server/Build-system-changes.patch @@ -41,14 +41,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 ) for (tld in setOf("net", "com", "org")) { attributes("$tld/bukkit", "Sealed" to true) -@@ -0,0 +0,0 @@ tasks.shadowJar { - configurations = listOf(project.configurations.vanillaServer.get()) +@@ -0,0 +0,0 @@ publishing { + } } +// Paper start +val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) { + badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;") -+ jarToScan.set(tasks.shadowJar.flatMap { it.archiveFile }) ++ jarToScan.set(tasks.serverJar.flatMap { it.archiveFile }) + classpath.from(configurations.compileClasspath) +} +tasks.check { diff --git a/patches/server/Setup-Gradle-project.patch b/patches/server/Setup-Gradle-project.patch index a296f40603..a41aed5543 100644 --- a/patches/server/Setup-Gradle-project.patch +++ b/patches/server/Setup-Gradle-project.patch @@ -37,7 +37,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +plugins { + java + `maven-publish` -+ id("com.github.johnrengelman.shadow") +} + +dependencies { @@ -90,10 +89,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + } +} + -+tasks.shadowJar { -+ configurations = listOf(project.configurations.vanillaServer.get()) -+} -+ +tasks.test { + exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") + useJUnitPlatform() diff --git a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch index 07441aa8c4..3062533ba4 100644 --- a/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch +++ b/patches/server/Use-TerminalConsoleAppender-for-console-improvements.patch @@ -29,7 +29,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -0,0 +0,0 @@ plugins { - id("com.github.johnrengelman.shadow") + `maven-publish` } +val log4jPlugins = sourceSets.create("log4jPlugins") @@ -60,15 +60,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion implementation("org.ow2.asm:asm-commons:9.7") implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files -@@ -0,0 +0,0 @@ publishing { +@@ -0,0 +0,0 @@ tasks.check { + dependsOn(scanJar) } + // Paper end ++// Paper start - use TCA for console improvements ++tasks.serverJar { ++ from(alsoShade.elements.map { ++ it.map { f -> ++ if (f.asFile.isFile) { ++ zipTree(f.asFile) ++ } else { ++ f.asFile ++ } ++ } ++ }) ++} ++// Paper end - use TCA for console improvements - tasks.shadowJar { -- configurations = listOf(project.configurations.vanillaServer.get()) -+ configurations = listOf(project.configurations.vanillaServer.get(), alsoShade) // Paper - } - - // Paper start + tasks.test { + exclude("org/bukkit/craftbukkit/inventory/ItemStack*Test.class") diff --git a/src/log4jPlugins/java/io/papermc/paper/console/StripANSIConverter.java b/src/log4jPlugins/java/io/papermc/paper/console/StripANSIConverter.java new file mode 100644 index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 diff --git a/patches/server/build-replace-use-of-shadow-plugin.patch b/patches/server/build-replace-use-of-shadow-plugin.patch deleted file mode 100644 index 4ea09ba501..0000000000 --- a/patches/server/build-replace-use-of-shadow-plugin.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> -Date: Thu, 18 Apr 2024 13:39:18 -0700 -Subject: [PATCH] build: replace use of shadow plugin - - -diff --git a/build.gradle.kts b/build.gradle.kts -index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 ---- a/build.gradle.kts -+++ b/build.gradle.kts -@@ -0,0 +0,0 @@ import xyz.jpenilla.runpaper.task.RunServer - plugins { - java - `maven-publish` -- id("com.github.johnrengelman.shadow") - id("xyz.jpenilla.run-paper") version "2.2.3" apply false - } - -@@ -0,0 +0,0 @@ publishing { - } - } - --tasks.shadowJar { -- configurations = listOf(project.configurations.vanillaServer.get(), alsoShade) // Paper -+tasks.serverJar { -+ from(alsoShade.elements.map { -+ it.map { f -> -+ if (f.asFile.isFile) { -+ zipTree(f.asFile) -+ } else { -+ f.asFile -+ } -+ } -+ }) - } - - // Paper start - val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) { - badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;") -- jarToScan.set(tasks.shadowJar.flatMap { it.archiveFile }) -+ jarToScan.set(tasks.serverJar.flatMap { it.archiveFile }) - classpath.from(configurations.compileClasspath) - } - tasks.check {