You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/paper/dev/getting-started/userdev.mdx
+25-27Lines changed: 25 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,23 +18,20 @@ check out this [example plugin](https://github.com/PaperMC/paperweight-test-plug
18
18
:::
19
19
20
20
## Why this is useful
21
-
The Paper server JARs we provide on the downloads page through the API are **paperclip** JARs. These
22
-
use Spigot's mappings, which are essentially some type names, but fully obfuscated fields and methods.
23
-
This can make it hard to work with in a development environment. This plugin lets you use fully deobfuscated
24
-
types, names, and fields during development, and then remaps your plugin, so it can still be used with the obfuscated
25
-
server.
21
+
This is the only supported way of accessing server internals, as redistributing the server JAR is against the
22
+
Minecraft EULA and general license assumption. Even if you manually depended on the patched server, you would be
23
+
hindering other people working on your project and would be missing deployed API javadocs/sources in your IDE.
26
24
27
-
:::caution[1.20.5]
25
+
On top of that, Spigot and pre-1.20.5 Paper versions still use Spigot mappings, which are a mix of obfuscated fields/methods
26
+
and mapped as well as custom named classes. This can make it hard to work with in a development environment. This plugin lets you use
27
+
fully deobfuscated types, names, and fields during development, and then remaps your plugin, so it can still be used with the obfuscated
28
+
server. However, this does not apply to reflection. Look at something like [this library](https://github.com/jpenilla/reflection-remapper) to be able to
29
+
use non-obfuscated names in reflection if you want to support obfuscated servers.
28
30
29
-
As of Minecraft version 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings.
30
-
See [here](#1205-and-beyond) for more details.
31
-
32
-
:::
31
+
:::info[1.20.5 Mojang-mapped runtime]
33
32
34
-
:::caution
35
-
36
-
The re-obfuscation does not apply to reflection. Look at something like [this library](https://github.com/jpenilla/reflection-remapper) to be able to
37
-
use non-obfuscated names in reflection.
33
+
As of Minecraft version 1.20.5, Paper ships with a Mojang-mapped runtime instead of re-obfuscating the server to Spigot mappings.
34
+
See [here](#1205-and-beyond) for more details.
38
35
39
36
:::
40
37
@@ -112,38 +109,39 @@ tasks.assemble {
112
109
113
110
## 1.20.5 and beyond
114
111
115
-
As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings.
112
+
As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of re-obfuscating the server to Spigot mappings.
116
113
Additionally, CraftBukkit classes will no longer be relocated into a versioned package.
117
114
This requires plugins to be deobfuscated before loading when necessary.
118
115
119
-
Most of this process is done automatically by paperweight but there are some important things to know when using NMS from now on.
116
+
Most of this process is done automatically by paperweight, but there are some important things to know when using server internals (or "NMS") from now on.
120
117
121
118
### Default mappings assumption
122
-
* 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.
119
+
* By default, all Spigot/Bukkit plugins will be assumed to be Spigot-mapped if they do not specify their mappings namespace in the manifest.
120
+
The other way around, all Paper plugins will be assumed to be Mojang-mapped if they do not specify their mappings namespace in the manifest.
123
121
* Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not.
124
122
125
-
### Mojang mappings
123
+
### Compiling to Mojang mappings
126
124
127
-
If you want to map your plugin with Mojang mappings, you need to add the following code to your build script:
125
+
:::info
128
126
129
-
:::note
130
-
131
-
You only have to change this setting if you are using Bukkit/Spigot plugins. Paper plugins are already assumed to be Mojang-mapped.
127
+
This is the preferred option, as the one-time plugin remapping process during server startup will be skipped and it
128
+
may allow you to keep version compatibility across smaller updates without changes or additional modules.
129
+
However, this makes your plugin incompatible with Spigot servers.
132
130
133
131
:::
134
132
133
+
If you want your main output to use Mojang mappings, you need to remove all `dependsOn(reobfJar)` lines and add the following code to your build script:
0 commit comments