From ea0336dff57f6c3cab42d5e94ae7a82718578dde Mon Sep 17 00:00:00 2001 From: Kyle Wood Date: Sun, 20 Jun 2021 02:47:14 -0500 Subject: [PATCH] Bump paperweight to 1.1.5 with support for patching reobf mappings --- build-data/reobf-mappings-patch.tiny | 15 +++++++++++++++ build.gradle.kts | 15 ++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 build-data/reobf-mappings-patch.tiny diff --git a/build-data/reobf-mappings-patch.tiny b/build-data/reobf-mappings-patch.tiny new file mode 100644 index 000000000..f12c799ff --- /dev/null +++ b/build-data/reobf-mappings-patch.tiny @@ -0,0 +1,15 @@ +# We would like for paperweight to generate 100% perfect reobf mappings (and deobf mappings for that matter). +# But unfortunately it's not quite there yet - and it may be some time before that happens. Generating perfect mappings +# from Spigot's mappings is extremely difficult due to Spigot's bad tooling and bad mappings. To add insult to injury +# we remap Spigot's _source code_ which is a lot more complex and error-prone than bytecode remapping. So with all that +# said, this file exists to help fill in the gap. +# +# We will continue to improve paperweight and will work on fixing these issues so they don't come up in the first place, +# but these mappings exist to prevent these issues from holding everything else in Paper up while we work through all +# of these issues. Due to the complex nature of mappings generation and the debugging difficulty involved it may take +# a significant amount of time for us to track down every possible issue, so this file will likely be around and in +# use - at least in some capacity - for a long time. + +tiny 2 0 mojang+yarn spigot +c net/minecraft/server/level/ServerLevel net/minecraft/server/level/WorldServer + f Lnet/minecraft/world/level/storage/PrimaryLevelData; serverLevelData E diff --git a/build.gradle.kts b/build.gradle.kts index 521f94c60..49acd816e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ plugins { java id("com.github.johnrengelman.shadow") version "7.0.0" apply false - id("io.papermc.paperweight.core") version "1.1.4" + id("io.papermc.paperweight.core") version "1.1.5" } subprojects { @@ -76,18 +76,19 @@ paperweight { serverProject.set(project(":Paper-Server")) paper { - spigotApiPatchDir.set(file("patches/api")) - spigotServerPatchDir.set(file("patches/server")) + spigotApiPatchDir.set(layout.projectDirectory.dir("patches/api")) + spigotServerPatchDir.set(layout.projectDirectory.dir("patches/server")) - mappingsPatch.set(file("build-data/mappings-patch.tiny")) + mappingsPatch.set(layout.projectDirectory.file("build-data/mappings-patch.tiny")) + reobfMappingsPatch.set(layout.projectDirectory.file("build-data/reobf-mappings-patch.tiny")) - additionalSpigotMemberMappings.set(file("build-data/additional-spigot-member-mappings.csrg")) - craftBukkitPatchPatchesDir.set(file("build-data/craftbukkit-patch-patches")) + additionalSpigotMemberMappings.set(layout.projectDirectory.file("build-data/additional-spigot-member-mappings.csrg")) + craftBukkitPatchPatchesDir.set(layout.projectDirectory.dir("build-data/craftbukkit-patch-patches")) } } tasks.register("printMinecraftVersion") { doLast { - println(providers.gradleProperty("mcVersion").forUseAtConfigurationTime().get().trim()) + println(providers.gradleProperty("mcVersion").get().trim()) } }