From e8b7d0c90256913b2a32d5867c0df8e4bbb12b61 Mon Sep 17 00:00:00 2001 From: leguan Date: Sun, 28 Apr 2024 14:41:10 +0200 Subject: [PATCH 01/18] add info about plugin remapping and update paperweight version. --- .../dev/getting-started/project-setup.mdx | 43 +++++++++++++++++++ docs/paper/dev/getting-started/userdev.mdx | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index 1c96e8b36..9214d1ef3 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -187,6 +187,49 @@ If everything went well, you should see something like this: ![](assets/paper-plugin-overview.png) +## Plugin remapping + +As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. +If you are using Spigot/Bukkit plugins, your plugin will automatically be remapped to Spigot mappings. +This means that the server will have to deobfuscate and remap the plugin jar every time it is loaded for the first time. +If you want to skip remapping, you need to add the following code to your `build.gradle(.kts)`. + +:::note[Paper plugins] + +if you are using paper plugins this step is not needed as plugins will be assumed to be Mojang-mapped. + +::: + +```groovy title="build.gradle(.kts)" +tasks.jar { + manifest { + attributes["paperweight-mappings-namespace"] = "mojang" + } +} + +//if you have shadowJar configured +tasks.shadowJar { + manifest { + attributes["paperweight-mappings-namespace"] = "mojang" + } +} +``` + +```xml title="pom.xml" + + org.apache.maven.plugins + maven-jar-plugin + 3.4.1 + + + + mojang + + + + +``` + ## Conclusion You should now have a project set up with Paper as a dependency. diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 831d3cc57..74b937cf8 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -35,7 +35,7 @@ use non-obfuscated names in reflection. Add the plugin to your `build.gradle.kts` file. ```kotlin plugins { - id("io.papermc.paperweight.userdev") version "1.5.12" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev + id("io.papermc.paperweight.userdev") version "1.6.2" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev } ``` From e78000bfbff68a5d3b9953ddcd726f6a9807e3de Mon Sep 17 00:00:00 2001 From: leguan Date: Sun, 28 Apr 2024 15:17:43 +0200 Subject: [PATCH 02/18] add paper.disable-plugin-rewriting system property. --- docs/paper/admin/reference/system-properties.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/paper/admin/reference/system-properties.md b/docs/paper/admin/reference/system-properties.md index d8e734093..7ca29f144 100644 --- a/docs/paper/admin/reference/system-properties.md +++ b/docs/paper/admin/reference/system-properties.md @@ -210,3 +210,8 @@ It also remaps plugin CB calls to remove the version information. - **default**: `false` - **description**: Disables Paper's automatic upgrading of commands, including items with custom data defined in command blocks and other places that may contain commands, to the new component format introduced in version 1.20.5. + +#### paper.disable-plugin-rewriting + +- **default**: `false` +- **description**: Disables plugin remapping and everything involving automatic plugin conversion by commodore. From 60d4feecd3eeedbf024cc17c3d3f5b923b6fd336 Mon Sep 17 00:00:00 2001 From: leguan Date: Sun, 28 Apr 2024 16:05:00 +0200 Subject: [PATCH 03/18] add userdev changes --- docs/paper/dev/getting-started/userdev.mdx | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 74b937cf8..8fbe81a9c 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -24,6 +24,12 @@ This can make it hard to work with in a development environment. This plugin let types, names, and fields during development, and then remaps your plugin, so it can still be used with the obfuscated server. +:::caution[1.20.5] + +As of Minecraft version 1.20.5 Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +See [Mojang-Mappings](#1205) for more details. +::: + :::caution The re-obfuscation does not apply to reflection. Look at something like [this library](https://github.com/jpenilla/reflection-remapper) to be able to @@ -103,3 +109,27 @@ tasks.assemble { } ``` +## 1.20.5 +As of 1.20.5 Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +Additionally. CraftBukkit classes will no longer be relocated into a versioned package. +This requires plugins to be deobfuscated before loading when necessary. + +Most of this process is done automatically by paperweight but there are some important things to know when using NMS from now on. + +### Default Mappings Assumption +* By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. +* Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. + +If you want to map your pluign to Mojang-mappings you need to add the following code to your build script: + +:::note + +If you still want to target Spigot, you do not have to change anything. + +::: + +```kotlin title="build.gadle.kts" +paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION +``` + +additionally you need to remove all `dependsOn(reobfJar)` lines. From d87554fe618c47e958c5cdf6efde48e44497cbea Mon Sep 17 00:00:00 2001 From: leguan <59799222+Leguan16@users.noreply.github.com> Date: Sun, 28 Apr 2024 16:15:52 +0200 Subject: [PATCH 04/18] fix typo --- docs/paper/dev/getting-started/userdev.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 8fbe81a9c..2940829bd 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -120,7 +120,7 @@ Most of this process is done automatically by paperweight but there are some imp * By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. * Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. -If you want to map your pluign to Mojang-mappings you need to add the following code to your build script: +If you want to map your plugin to Mojang-mappings you need to add the following code to your build script: :::note From eddc4b028217fa53550d3d1e359e4609235cb29c Mon Sep 17 00:00:00 2001 From: leguan <59799222+Leguan16@users.noreply.github.com> Date: Sun, 28 Apr 2024 16:34:16 +0200 Subject: [PATCH 05/18] Fix a few typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matouš Kučera --- docs/paper/dev/getting-started/project-setup.mdx | 8 ++++---- docs/paper/dev/getting-started/userdev.mdx | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index 9214d1ef3..f5ec57c43 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -191,23 +191,23 @@ If everything went well, you should see something like this: As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. If you are using Spigot/Bukkit plugins, your plugin will automatically be remapped to Spigot mappings. -This means that the server will have to deobfuscate and remap the plugin jar every time it is loaded for the first time. +This means that the server will have to deobfuscate and remap the plugin JAR every time it is loaded for the first time. If you want to skip remapping, you need to add the following code to your `build.gradle(.kts)`. :::note[Paper plugins] -if you are using paper plugins this step is not needed as plugins will be assumed to be Mojang-mapped. +If you are using Paper plugins, this step is not needed as plugins will be assumed to be Mojang-mapped. ::: -```groovy title="build.gradle(.kts)" +```kotlin title="build.gradle.kts" tasks.jar { manifest { attributes["paperweight-mappings-namespace"] = "mojang" } } -//if you have shadowJar configured +// if you have shadowJar configured tasks.shadowJar { manifest { attributes["paperweight-mappings-namespace"] = "mojang" diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 2940829bd..b7523963b 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -26,8 +26,8 @@ server. :::caution[1.20.5] -As of Minecraft version 1.20.5 Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. -See [Mojang-Mappings](#1205) for more details. +As of Minecraft version 1.20.5, Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +See [here](#1205) for more details. ::: :::caution @@ -110,17 +110,17 @@ tasks.assemble { ``` ## 1.20.5 -As of 1.20.5 Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. -Additionally. CraftBukkit classes will no longer be relocated into a versioned package. +As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +Additionally, CraftBukkit classes will no longer be relocated into a versioned package. This requires plugins to be deobfuscated before loading when necessary. Most of this process is done automatically by paperweight but there are some important things to know when using NMS from now on. -### Default Mappings Assumption +### Default mappings assumption * By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. * Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. -If you want to map your plugin to Mojang-mappings you need to add the following code to your build script: +If you want to map your plugin with Mojang mappings, you need to add the following code to your build script: :::note @@ -128,8 +128,8 @@ If you still want to target Spigot, you do not have to change anything. ::: -```kotlin title="build.gadle.kts" +```kotlin title="build.gradle.kts" paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION ``` -additionally you need to remove all `dependsOn(reobfJar)` lines. +Additionally, you need to remove all `dependsOn(reobfJar)` lines. From 3906a60e3dbf50c38c26d884a1df16b2b88d18e6 Mon Sep 17 00:00:00 2001 From: leguan Date: Wed, 1 May 2024 17:22:59 +0200 Subject: [PATCH 06/18] address comments --- .../dev/getting-started/project-setup.mdx | 48 ++++++++++++++++++- docs/paper/dev/getting-started/userdev.mdx | 16 +++++-- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index f5ec57c43..cf8ef268f 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -189,10 +189,19 @@ If everything went well, you should see something like this: ## Plugin remapping -As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. +As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. If you are using Spigot/Bukkit plugins, your plugin will automatically be remapped to Spigot mappings. This means that the server will have to deobfuscate and remap the plugin JAR every time it is loaded for the first time. -If you want to skip remapping, you need to add the following code to your `build.gradle(.kts)`. + +:::info + +Paperweight-userdev already sets this attribute automatically. For more information see the [userdev](./userdev) documentation. + +::: + +### Mojang mappings + +To tell the server that your plugin is Mojang mapped, you need to add the following code to your build script: :::note[Paper plugins] @@ -230,6 +239,41 @@ tasks.shadowJar { ``` +### Spigot mappings + +If you explicitly want to tell the server that your plugin is Spigot mapped, you need to add the following code to your build script: + +```kotlin title="build.gradle.kts" +tasks.jar { + manifest { + attributes["paperweight-mappings-namespace"] = "spigot" + } +} + +// if you have shadowJar configured +tasks.shadowJar { + manifest { + attributes["paperweight-mappings-namespace"] = "spigot" + } +} +``` + +```xml title="pom.xml" + + org.apache.maven.plugins + maven-jar-plugin + 3.4.1 + + + + spigot + + + + +``` + + ## Conclusion You should now have a project set up with Paper as a dependency. diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index b7523963b..ae92256fc 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -26,7 +26,7 @@ server. :::caution[1.20.5] -As of Minecraft version 1.20.5, Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +As of Minecraft version 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. See [here](#1205) for more details. ::: @@ -110,7 +110,7 @@ tasks.assemble { ``` ## 1.20.5 -As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. Additionally, CraftBukkit classes will no longer be relocated into a versioned package. This requires plugins to be deobfuscated before loading when necessary. @@ -120,11 +120,12 @@ Most of this process is done automatically by paperweight but there are some imp * By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. * Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. +### Mojang mappings If you want to map your plugin with Mojang mappings, you need to add the following code to your build script: :::note -If you still want to target Spigot, you do not have to change anything. +You only have to change this setting if you are using Bukkit/Spigot plugins. Paper plugins are already assumed to be mojang mapped. ::: @@ -133,3 +134,12 @@ paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArt ``` Additionally, you need to remove all `dependsOn(reobfJar)` lines. + +### Spigot mappings +If you are using Paper plugins but want to explicitly use spigot mappings, you need to change the property to: + +```kotlin title="build.gradle.kts" +paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION +``` + + From 70348e6879813076fa40623664a3373bd9a6346a Mon Sep 17 00:00:00 2001 From: leguan Date: Wed, 1 May 2024 20:59:32 +0200 Subject: [PATCH 07/18] address more comments --- docs/paper/dev/getting-started/project-setup.mdx | 6 +++--- docs/paper/dev/getting-started/userdev.mdx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index cf8ef268f..35cd2d1a6 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -195,13 +195,13 @@ This means that the server will have to deobfuscate and remap the plugin JAR eve :::info -Paperweight-userdev already sets this attribute automatically. For more information see the [userdev](./userdev) documentation. +`paperweight-userdev` already sets this attribute automatically. For more information see the [userdev](./userdev) documentation. ::: ### Mojang mappings -To tell the server that your plugin is Mojang mapped, you need to add the following code to your build script: +To tell the server that your plugin is Mojang-mapped, you need to add the following code to your build script: :::note[Paper plugins] @@ -241,7 +241,7 @@ tasks.shadowJar { ### Spigot mappings -If you explicitly want to tell the server that your plugin is Spigot mapped, you need to add the following code to your build script: +If you explicitly want to tell the server that your plugin is Spigot-mapped, you need to add the following code to your build script: ```kotlin title="build.gradle.kts" tasks.jar { diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index ae92256fc..0f15177b1 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -125,7 +125,7 @@ If you want to map your plugin with Mojang mappings, you need to add the followi :::note -You only have to change this setting if you are using Bukkit/Spigot plugins. Paper plugins are already assumed to be mojang mapped. +You only have to change this setting if you are using Bukkit/Spigot plugins. Paper plugins are already assumed to be Mojang-mapped. ::: @@ -136,7 +136,7 @@ paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArt Additionally, you need to remove all `dependsOn(reobfJar)` lines. ### Spigot mappings -If you are using Paper plugins but want to explicitly use spigot mappings, you need to change the property to: +If you are using Paper plugins but want to explicitly use Spigot mappings, you need to change the property to: ```kotlin title="build.gradle.kts" paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION From 00684f670254747d42bd6ecf4410fc638e0e9046 Mon Sep 17 00:00:00 2001 From: leguan <59799222+Leguan16@users.noreply.github.com> Date: Wed, 1 May 2024 21:09:44 +0200 Subject: [PATCH 08/18] update paperweight version --- docs/paper/dev/getting-started/userdev.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 0f15177b1..082511402 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -41,7 +41,7 @@ use non-obfuscated names in reflection. Add the plugin to your `build.gradle.kts` file. ```kotlin plugins { - id("io.papermc.paperweight.userdev") version "1.6.2" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev + id("io.papermc.paperweight.userdev") version "1.7.0" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev } ``` From 8148870da964112f35b1eb36b6ca501cf8189818 Mon Sep 17 00:00:00 2001 From: Bjarne Koll Date: Thu, 2 May 2024 18:52:23 +0200 Subject: [PATCH 09/18] fix: Update empty scoreboard team default (#368) Changed in https://github.com/PaperMC/Paper/commit/59fe7ccc3b067676e5c8b85ccfac915c493f54d9 --- config-specs/paper/paper-global.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-specs/paper/paper-global.yml b/config-specs/paper/paper-global.yml index f2bb12e8d..c4aef958d 100644 --- a/config-specs/paper/paper-global.yml +++ b/config-specs/paper/paper-global.yml @@ -317,7 +317,7 @@ proxies: forwarding.secret file scoreboards: save-empty-scoreboard-teams: - default: "false" + default: "true" description: >- Some scoreboard plugins leave hundreds of empty scoreboard teams around, dramatically slowing down login times. This sets whether the server should From f20ce9cee7c3fb0a3a2d13f56ad3f5b2d7488577 Mon Sep 17 00:00:00 2001 From: leguan Date: Sun, 28 Apr 2024 14:41:10 +0200 Subject: [PATCH 10/18] add info about plugin remapping and update paperweight version. --- .../dev/getting-started/project-setup.mdx | 43 +++++++++++++++++++ docs/paper/dev/getting-started/userdev.mdx | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index 1c96e8b36..9214d1ef3 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -187,6 +187,49 @@ If everything went well, you should see something like this: ![](assets/paper-plugin-overview.png) +## Plugin remapping + +As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. +If you are using Spigot/Bukkit plugins, your plugin will automatically be remapped to Spigot mappings. +This means that the server will have to deobfuscate and remap the plugin jar every time it is loaded for the first time. +If you want to skip remapping, you need to add the following code to your `build.gradle(.kts)`. + +:::note[Paper plugins] + +if you are using paper plugins this step is not needed as plugins will be assumed to be Mojang-mapped. + +::: + +```groovy title="build.gradle(.kts)" +tasks.jar { + manifest { + attributes["paperweight-mappings-namespace"] = "mojang" + } +} + +//if you have shadowJar configured +tasks.shadowJar { + manifest { + attributes["paperweight-mappings-namespace"] = "mojang" + } +} +``` + +```xml title="pom.xml" + + org.apache.maven.plugins + maven-jar-plugin + 3.4.1 + + + + mojang + + + + +``` + ## Conclusion You should now have a project set up with Paper as a dependency. diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 831d3cc57..74b937cf8 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -35,7 +35,7 @@ use non-obfuscated names in reflection. Add the plugin to your `build.gradle.kts` file. ```kotlin plugins { - id("io.papermc.paperweight.userdev") version "1.5.12" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev + id("io.papermc.paperweight.userdev") version "1.6.2" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev } ``` From ef35d0cecd410333295882d1bd72ed1f848e3124 Mon Sep 17 00:00:00 2001 From: leguan Date: Sun, 28 Apr 2024 15:17:43 +0200 Subject: [PATCH 11/18] add paper.disable-plugin-rewriting system property. --- docs/paper/admin/reference/system-properties.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/paper/admin/reference/system-properties.md b/docs/paper/admin/reference/system-properties.md index d8e734093..7ca29f144 100644 --- a/docs/paper/admin/reference/system-properties.md +++ b/docs/paper/admin/reference/system-properties.md @@ -210,3 +210,8 @@ It also remaps plugin CB calls to remove the version information. - **default**: `false` - **description**: Disables Paper's automatic upgrading of commands, including items with custom data defined in command blocks and other places that may contain commands, to the new component format introduced in version 1.20.5. + +#### paper.disable-plugin-rewriting + +- **default**: `false` +- **description**: Disables plugin remapping and everything involving automatic plugin conversion by commodore. From 66c21b9a45ab242d55d79d6677de706c8d82f053 Mon Sep 17 00:00:00 2001 From: leguan Date: Sun, 28 Apr 2024 16:05:00 +0200 Subject: [PATCH 12/18] add userdev changes --- docs/paper/dev/getting-started/userdev.mdx | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 74b937cf8..8fbe81a9c 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -24,6 +24,12 @@ This can make it hard to work with in a development environment. This plugin let types, names, and fields during development, and then remaps your plugin, so it can still be used with the obfuscated server. +:::caution[1.20.5] + +As of Minecraft version 1.20.5 Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +See [Mojang-Mappings](#1205) for more details. +::: + :::caution The re-obfuscation does not apply to reflection. Look at something like [this library](https://github.com/jpenilla/reflection-remapper) to be able to @@ -103,3 +109,27 @@ tasks.assemble { } ``` +## 1.20.5 +As of 1.20.5 Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +Additionally. CraftBukkit classes will no longer be relocated into a versioned package. +This requires plugins to be deobfuscated before loading when necessary. + +Most of this process is done automatically by paperweight but there are some important things to know when using NMS from now on. + +### Default Mappings Assumption +* By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. +* Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. + +If you want to map your pluign to Mojang-mappings you need to add the following code to your build script: + +:::note + +If you still want to target Spigot, you do not have to change anything. + +::: + +```kotlin title="build.gadle.kts" +paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION +``` + +additionally you need to remove all `dependsOn(reobfJar)` lines. From c2b5a1eae2488e74f8e7054ca24e78878062a557 Mon Sep 17 00:00:00 2001 From: leguan <59799222+Leguan16@users.noreply.github.com> Date: Sun, 28 Apr 2024 16:15:52 +0200 Subject: [PATCH 13/18] fix typo --- docs/paper/dev/getting-started/userdev.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 8fbe81a9c..2940829bd 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -120,7 +120,7 @@ Most of this process is done automatically by paperweight but there are some imp * By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. * Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. -If you want to map your pluign to Mojang-mappings you need to add the following code to your build script: +If you want to map your plugin to Mojang-mappings you need to add the following code to your build script: :::note From a42a3a8769afbbf28c0b3e7831c0cdfd3549f285 Mon Sep 17 00:00:00 2001 From: leguan <59799222+Leguan16@users.noreply.github.com> Date: Sun, 28 Apr 2024 16:34:16 +0200 Subject: [PATCH 14/18] Fix a few typos MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Matouš Kučera --- docs/paper/dev/getting-started/project-setup.mdx | 8 ++++---- docs/paper/dev/getting-started/userdev.mdx | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index 9214d1ef3..f5ec57c43 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -191,23 +191,23 @@ If everything went well, you should see something like this: As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. If you are using Spigot/Bukkit plugins, your plugin will automatically be remapped to Spigot mappings. -This means that the server will have to deobfuscate and remap the plugin jar every time it is loaded for the first time. +This means that the server will have to deobfuscate and remap the plugin JAR every time it is loaded for the first time. If you want to skip remapping, you need to add the following code to your `build.gradle(.kts)`. :::note[Paper plugins] -if you are using paper plugins this step is not needed as plugins will be assumed to be Mojang-mapped. +If you are using Paper plugins, this step is not needed as plugins will be assumed to be Mojang-mapped. ::: -```groovy title="build.gradle(.kts)" +```kotlin title="build.gradle.kts" tasks.jar { manifest { attributes["paperweight-mappings-namespace"] = "mojang" } } -//if you have shadowJar configured +// if you have shadowJar configured tasks.shadowJar { manifest { attributes["paperweight-mappings-namespace"] = "mojang" diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 2940829bd..b7523963b 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -26,8 +26,8 @@ server. :::caution[1.20.5] -As of Minecraft version 1.20.5 Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. -See [Mojang-Mappings](#1205) for more details. +As of Minecraft version 1.20.5, Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +See [here](#1205) for more details. ::: :::caution @@ -110,17 +110,17 @@ tasks.assemble { ``` ## 1.20.5 -As of 1.20.5 Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. -Additionally. CraftBukkit classes will no longer be relocated into a versioned package. +As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +Additionally, CraftBukkit classes will no longer be relocated into a versioned package. This requires plugins to be deobfuscated before loading when necessary. Most of this process is done automatically by paperweight but there are some important things to know when using NMS from now on. -### Default Mappings Assumption +### Default mappings assumption * By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. * Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. -If you want to map your plugin to Mojang-mappings you need to add the following code to your build script: +If you want to map your plugin with Mojang mappings, you need to add the following code to your build script: :::note @@ -128,8 +128,8 @@ If you still want to target Spigot, you do not have to change anything. ::: -```kotlin title="build.gadle.kts" +```kotlin title="build.gradle.kts" paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION ``` -additionally you need to remove all `dependsOn(reobfJar)` lines. +Additionally, you need to remove all `dependsOn(reobfJar)` lines. From a3aa9b16bde48ad1a4cb31725880785c2e7beb49 Mon Sep 17 00:00:00 2001 From: leguan Date: Wed, 1 May 2024 17:22:59 +0200 Subject: [PATCH 15/18] address comments --- .../dev/getting-started/project-setup.mdx | 48 ++++++++++++++++++- docs/paper/dev/getting-started/userdev.mdx | 16 +++++-- 2 files changed, 59 insertions(+), 5 deletions(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index f5ec57c43..cf8ef268f 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -189,10 +189,19 @@ If everything went well, you should see something like this: ## Plugin remapping -As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. +As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. If you are using Spigot/Bukkit plugins, your plugin will automatically be remapped to Spigot mappings. This means that the server will have to deobfuscate and remap the plugin JAR every time it is loaded for the first time. -If you want to skip remapping, you need to add the following code to your `build.gradle(.kts)`. + +:::info + +Paperweight-userdev already sets this attribute automatically. For more information see the [userdev](./userdev) documentation. + +::: + +### Mojang mappings + +To tell the server that your plugin is Mojang mapped, you need to add the following code to your build script: :::note[Paper plugins] @@ -230,6 +239,41 @@ tasks.shadowJar { ``` +### Spigot mappings + +If you explicitly want to tell the server that your plugin is Spigot mapped, you need to add the following code to your build script: + +```kotlin title="build.gradle.kts" +tasks.jar { + manifest { + attributes["paperweight-mappings-namespace"] = "spigot" + } +} + +// if you have shadowJar configured +tasks.shadowJar { + manifest { + attributes["paperweight-mappings-namespace"] = "spigot" + } +} +``` + +```xml title="pom.xml" + + org.apache.maven.plugins + maven-jar-plugin + 3.4.1 + + + + spigot + + + + +``` + + ## Conclusion You should now have a project set up with Paper as a dependency. diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index b7523963b..ae92256fc 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -26,7 +26,7 @@ server. :::caution[1.20.5] -As of Minecraft version 1.20.5, Paper will be shipped with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +As of Minecraft version 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. See [here](#1205) for more details. ::: @@ -110,7 +110,7 @@ tasks.assemble { ``` ## 1.20.5 -As of 1.20.5, Paper will be shipping with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. +As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. Additionally, CraftBukkit classes will no longer be relocated into a versioned package. This requires plugins to be deobfuscated before loading when necessary. @@ -120,11 +120,12 @@ Most of this process is done automatically by paperweight but there are some imp * By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest. Conversely, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest. * Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. +### Mojang mappings If you want to map your plugin with Mojang mappings, you need to add the following code to your build script: :::note -If you still want to target Spigot, you do not have to change anything. +You only have to change this setting if you are using Bukkit/Spigot plugins. Paper plugins are already assumed to be mojang mapped. ::: @@ -133,3 +134,12 @@ paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArt ``` Additionally, you need to remove all `dependsOn(reobfJar)` lines. + +### Spigot mappings +If you are using Paper plugins but want to explicitly use spigot mappings, you need to change the property to: + +```kotlin title="build.gradle.kts" +paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION +``` + + From c42ec5b393ced843ddc5b3206f7f3dfcbd7a19e0 Mon Sep 17 00:00:00 2001 From: leguan Date: Wed, 1 May 2024 20:59:32 +0200 Subject: [PATCH 16/18] address more comments --- docs/paper/dev/getting-started/project-setup.mdx | 6 +++--- docs/paper/dev/getting-started/userdev.mdx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index cf8ef268f..35cd2d1a6 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -195,13 +195,13 @@ This means that the server will have to deobfuscate and remap the plugin JAR eve :::info -Paperweight-userdev already sets this attribute automatically. For more information see the [userdev](./userdev) documentation. +`paperweight-userdev` already sets this attribute automatically. For more information see the [userdev](./userdev) documentation. ::: ### Mojang mappings -To tell the server that your plugin is Mojang mapped, you need to add the following code to your build script: +To tell the server that your plugin is Mojang-mapped, you need to add the following code to your build script: :::note[Paper plugins] @@ -241,7 +241,7 @@ tasks.shadowJar { ### Spigot mappings -If you explicitly want to tell the server that your plugin is Spigot mapped, you need to add the following code to your build script: +If you explicitly want to tell the server that your plugin is Spigot-mapped, you need to add the following code to your build script: ```kotlin title="build.gradle.kts" tasks.jar { diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index ae92256fc..0f15177b1 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -125,7 +125,7 @@ If you want to map your plugin with Mojang mappings, you need to add the followi :::note -You only have to change this setting if you are using Bukkit/Spigot plugins. Paper plugins are already assumed to be mojang mapped. +You only have to change this setting if you are using Bukkit/Spigot plugins. Paper plugins are already assumed to be Mojang-mapped. ::: @@ -136,7 +136,7 @@ paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArt Additionally, you need to remove all `dependsOn(reobfJar)` lines. ### Spigot mappings -If you are using Paper plugins but want to explicitly use spigot mappings, you need to change the property to: +If you are using Paper plugins but want to explicitly use Spigot mappings, you need to change the property to: ```kotlin title="build.gradle.kts" paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION From 08e1d05da6b4f8dbe5de69a6fa0d7c8a86a4fe77 Mon Sep 17 00:00:00 2001 From: leguan Date: Thu, 2 May 2024 19:43:33 +0200 Subject: [PATCH 17/18] address even more comments --- docs/paper/admin/reference/system-properties.md | 2 +- docs/paper/dev/getting-started/project-setup.mdx | 4 ++-- docs/paper/dev/getting-started/userdev.mdx | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/paper/admin/reference/system-properties.md b/docs/paper/admin/reference/system-properties.md index 7ca29f144..f334c3afa 100644 --- a/docs/paper/admin/reference/system-properties.md +++ b/docs/paper/admin/reference/system-properties.md @@ -214,4 +214,4 @@ It also remaps plugin CB calls to remove the version information. #### paper.disable-plugin-rewriting - **default**: `false` -- **description**: Disables plugin remapping and everything involving automatic plugin conversion by commodore. +- **description**: Disables plugin remapping introduced in 1.20.5 and everything involving automatic plugin conversion by commodore. For more information see the [userdev](../../dev/getting-started/userdev.mdx#1205) documentation and the official [announcement](https://discord.com/channels/289587909051416579/976631292747735080/1232740079097876570). diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index 35cd2d1a6..3f1535f6d 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -190,8 +190,8 @@ If everything went well, you should see something like this: ## Plugin remapping As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. -If you are using Spigot/Bukkit plugins, your plugin will automatically be remapped to Spigot mappings. -This means that the server will have to deobfuscate and remap the plugin JAR every time it is loaded for the first time. +If you are using Spigot/Bukkit plugins, your plugin will be assumed to be Spigot-mapped. +This means that the server will have to deobfuscate and remap the plugin JAR when it's loaded for the first time. :::info diff --git a/docs/paper/dev/getting-started/userdev.mdx b/docs/paper/dev/getting-started/userdev.mdx index 0f15177b1..bbf578af8 100644 --- a/docs/paper/dev/getting-started/userdev.mdx +++ b/docs/paper/dev/getting-started/userdev.mdx @@ -110,7 +110,8 @@ tasks.assemble { ``` ## 1.20.5 -As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings as we have traditionally done since Paper 1.17. + +As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings. Additionally, CraftBukkit classes will no longer be relocated into a versioned package. This requires plugins to be deobfuscated before loading when necessary. @@ -121,6 +122,7 @@ Most of this process is done automatically by paperweight but there are some imp * Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not. ### Mojang mappings + If you want to map your plugin with Mojang mappings, you need to add the following code to your build script: :::note @@ -136,6 +138,7 @@ paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArt Additionally, you need to remove all `dependsOn(reobfJar)` lines. ### Spigot mappings + If you are using Paper plugins but want to explicitly use Spigot mappings, you need to change the property to: ```kotlin title="build.gradle.kts" From b3cc528b1ea5d72b04f108dd53768765c05bbc27 Mon Sep 17 00:00:00 2001 From: leguan Date: Sat, 4 May 2024 15:30:08 +0200 Subject: [PATCH 18/18] tab --- .../dev/getting-started/project-setup.mdx | 105 ++++++++++-------- 1 file changed, 58 insertions(+), 47 deletions(-) diff --git a/docs/paper/dev/getting-started/project-setup.mdx b/docs/paper/dev/getting-started/project-setup.mdx index 3f1535f6d..b4824f01b 100644 --- a/docs/paper/dev/getting-started/project-setup.mdx +++ b/docs/paper/dev/getting-started/project-setup.mdx @@ -3,6 +3,10 @@ slug: /dev/project-setup description: Step-by-step instructions on how to set up a plugin development environment. --- +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + + # Paper Project Setup As the Paper team primarily uses [IntelliJ IDEA](https://www.jetbrains.com/idea/), this guide will be focused on that IDE. @@ -209,70 +213,77 @@ If you are using Paper plugins, this step is not needed as plugins will be assum ::: -```kotlin title="build.gradle.kts" -tasks.jar { - manifest { + + + ```kotlin + tasks.jar { + manifest { attributes["paperweight-mappings-namespace"] = "mojang" + } } -} - -// if you have shadowJar configured -tasks.shadowJar { - manifest { + // if you have shadowJar configured + tasks.shadowJar { + manifest { attributes["paperweight-mappings-namespace"] = "mojang" + } } -} -``` - -```xml title="pom.xml" - - org.apache.maven.plugins - maven-jar-plugin - 3.4.1 - + ``` + + + ```xml + + org.apache.maven.plugins + maven-jar-plugin + 3.4.1 + - - mojang - + + mojang + - - -``` + + + ``` + + ### Spigot mappings If you explicitly want to tell the server that your plugin is Spigot-mapped, you need to add the following code to your build script: -```kotlin title="build.gradle.kts" -tasks.jar { - manifest { + + + ```kotlin + tasks.jar { + manifest { attributes["paperweight-mappings-namespace"] = "spigot" + } } -} - -// if you have shadowJar configured -tasks.shadowJar { - manifest { + // if you have shadowJar configured + tasks.shadowJar { + manifest { attributes["paperweight-mappings-namespace"] = "spigot" + } } -} -``` - -```xml title="pom.xml" - - org.apache.maven.plugins - maven-jar-plugin - 3.4.1 - + ``` + + + ```xml + + org.apache.maven.plugins + maven-jar-plugin + 3.4.1 + - - spigot - + + spigot + - - -``` - + + + ``` + + ## Conclusion