From b5316a9eda9a32890c38e634ed69c2dd8e54bdd0 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:18:22 -0700 Subject: [PATCH 1/5] Update internal-code.mdx --- docs/paper/dev/misc/internal-code.mdx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/paper/dev/misc/internal-code.mdx b/docs/paper/dev/misc/internal-code.mdx index 814db1ccd..731288bd5 100644 --- a/docs/paper/dev/misc/internal-code.mdx +++ b/docs/paper/dev/misc/internal-code.mdx @@ -27,12 +27,12 @@ any time. ## Accessing Minecraft Internals -In order to use Mojang and CraftBukkit code, you may either use the Paperweight Userdev plugin or use reflection. -The [Paperweight Userdev](https://github.com/PaperMC/paperweight-test-plugin) plugin is the recommended way to access internal code +In order to use Mojang and CraftBukkit code, you may either use the `paperweight-userdev` Gradle plugin or use reflection. +[`paperweight-userdev`](https://github.com/PaperMC/paperweight-test-plugin) is the recommended way to access internal code as it is easier to use due to being able to have the remapped code in your IDE. You can find -out more about this in the [Paperweight Userdev](/paper/dev/userdev) section. +out more about this in the [`paperweight-userdev`](/paper/dev/userdev) section. -However, if you are unable to use the Userdev plugin, you can use reflection. +However, if you are unable to use `paperweight-userdev`, you can use reflection. ### Reflection @@ -59,7 +59,7 @@ Class.forName(cbClass("entity.CraftBee")); Minecraft's code is obfuscated. This means that the names of classes and methods are changed to make them harder to understand. Paper deobfuscates these identifiers for development; however, to provide compatibility with legacy plugins, -Paper is re-obfuscated at runtime. You can use a plugin like [Reflection Remapper](https://github.com/jpenilla/reflection-remapper) to automatically remap the +Paper is re-obfuscated at runtime. You can use a library like [reflection-remapper](https://github.com/jpenilla/reflection-remapper) to automatically remap the reflection references. This will allow you to use the de-obfuscated, Mojang-mapped, names in your code. This is recommended as it makes the code easier to understand. @@ -68,7 +68,7 @@ it makes the code easier to understand. Running a Mojang-Mapped (moj-map) server is an excellent way to streamline your processes because you can develop using the same mappings that will be present at runtime. This eliminates the need for remapping in your compilation. If you are creating custom plugins for your server, we highly recommend running a moj-map server. It simplifies debugging and -allows for you to hotswap plugins. +allows you to hotswap plugins. In the future, the Paper server will no longer undergo remapping. By adopting Mojang mappings now, you can ensure that your plugin won't require internal remapping when we make the switch. @@ -76,7 +76,7 @@ your plugin won't require internal remapping when we make the switch. ### Getting the current Minecraft version You can get the current Minecraft version to allow you to use the correct code for a specific version. This can be done -with the one of the following methods: +with one of the following methods: ```java // Example value: 1.20.2 From c5bf43960acd8d435944a9c0619fe4b4e1d39bdb Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:30:01 -0700 Subject: [PATCH 2/5] Update userdev.md --- docs/paper/dev/getting-started/userdev.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/paper/dev/getting-started/userdev.md b/docs/paper/dev/getting-started/userdev.md index 90a39082f..5a13898cc 100644 --- a/docs/paper/dev/getting-started/userdev.md +++ b/docs/paper/dev/getting-started/userdev.md @@ -1,7 +1,7 @@ --- slug: /dev/userdev sidebar_label: Paperweight Userdev -description: A guide on how to use the Paperweight Userdev Gradle plugin to access internal code. +description: A guide on how to use the paperweight-userdev Gradle plugin to access internal code. --- # paperweight-userdev @@ -11,7 +11,7 @@ provides access to internal code (also known as NMS) during development. :::note -This guide is written using the Kotlin DSL for Gradle and assumes you have some basic knowledge of Gradle. +This guide is written using the Gradle Kotlin DSL and assumes you have some basic knowledge of Gradle. If you want to see a fully-functioning plugin that uses **paperweight-userdev**, check out this [example plugin](https://github.com/PaperMC/paperweight-test-plugin). @@ -21,7 +21,7 @@ check out this [example plugin](https://github.com/PaperMC/paperweight-test-plug The Paper server jars we provide on the downloads page through the API are **paperclip** jars. These use Spigot's mappings, which are essentially some type names, but fully obfuscated fields and methods. This can make it hard to work with in a development environment. This plugin lets you use fully deobfuscated -types, names and fields during development, and then remaps your plugin, so it can still be used with the obfuscated +types, names, and fields during development, and then remaps your plugin, so it can still be used with the obfuscated server. :::caution @@ -35,13 +35,13 @@ 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.5" // the latest version can be found on the Gradle Plugin Portal + id("io.papermc.paperweight.userdev") version "1.5.10" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev } ``` :::info[Snapshots] -**paperweight-userdev** releases are available through the Gradle plugin portal, but if you +**paperweight-userdev** releases are available through the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev), but if you want to use SNAPSHOT versions, you must add Paper's maven repo to `settings.gradle.kts` with: ```kotlin pluginManagement { @@ -54,7 +54,7 @@ pluginManagement { ::: -## Adding the dev-bundle dependency +## Adding the dev bundle dependency If you try to load your Gradle project now, you will receive an error saying you have to declare a dev bundle dependency. You can do that by adding to your `dependencies` block in your `build.gradle.kts` file. @@ -67,7 +67,7 @@ dependencies { ``` :::tip -You can remove any dependency for the Paper API, as the dev bundle includes that. +You should remove any dependency on the Paper API, as the dev bundle includes that. ::: From 5f0a7a9563be20832bc148119b31f4bd55d2b428 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:42:33 -0700 Subject: [PATCH 3/5] Update userdev.md --- docs/paper/dev/getting-started/userdev.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/paper/dev/getting-started/userdev.md b/docs/paper/dev/getting-started/userdev.md index 5a13898cc..f5597a503 100644 --- a/docs/paper/dev/getting-started/userdev.md +++ b/docs/paper/dev/getting-started/userdev.md @@ -52,6 +52,9 @@ pluginManagement { } ``` +The latest version of `paperweight-userdev` supports dev bundles for Minecraft 1.17.1 and newer, so it's best practice to keep it up to date! +Only the latest version of `paperweight-userdev` is officially supported, and we will ask you to update first if you are having problems with old versions. + ::: ## Adding the dev bundle dependency From 4b78b144844d4909b43d8287955424886a1926ba Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:45:35 -0700 Subject: [PATCH 4/5] Update userdev.md --- docs/paper/dev/getting-started/userdev.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/paper/dev/getting-started/userdev.md b/docs/paper/dev/getting-started/userdev.md index f5597a503..73829dcaf 100644 --- a/docs/paper/dev/getting-started/userdev.md +++ b/docs/paper/dev/getting-started/userdev.md @@ -39,6 +39,9 @@ plugins { } ``` +The latest version of `paperweight-userdev` supports dev bundles for Minecraft 1.17.1 and newer, so it's best practice to keep it up to date! +Only the latest version of `paperweight-userdev` is officially supported, and we will ask you to update first if you are having problems with old versions. + :::info[Snapshots] **paperweight-userdev** releases are available through the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev), but if you @@ -52,9 +55,6 @@ pluginManagement { } ``` -The latest version of `paperweight-userdev` supports dev bundles for Minecraft 1.17.1 and newer, so it's best practice to keep it up to date! -Only the latest version of `paperweight-userdev` is officially supported, and we will ask you to update first if you are having problems with old versions. - ::: ## Adding the dev bundle dependency From 78ff56cf00a262cc8b8580599c0cb7bef92529a8 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Fri, 1 Dec 2023 14:48:17 -0700 Subject: [PATCH 5/5] Update userdev.md --- docs/paper/dev/getting-started/userdev.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/paper/dev/getting-started/userdev.md b/docs/paper/dev/getting-started/userdev.md index 73829dcaf..d0fd56799 100644 --- a/docs/paper/dev/getting-started/userdev.md +++ b/docs/paper/dev/getting-started/userdev.md @@ -45,7 +45,7 @@ Only the latest version of `paperweight-userdev` is officially supported, and we :::info[Snapshots] **paperweight-userdev** releases are available through the [Gradle Plugin Portal](https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev), but if you -want to use SNAPSHOT versions, you must add Paper's maven repo to `settings.gradle.kts` with: +want to use SNAPSHOT versions, you must add Paper's Maven repository to `settings.gradle.kts` with: ```kotlin pluginManagement { repositories {