Skip to content

Commit 9d42bbd

Browse files
committed
Clean up userdev page
1 parent c243622 commit 9d42bbd

File tree

1 file changed

+25
-27
lines changed

1 file changed

+25
-27
lines changed

docs/paper/dev/getting-started/userdev.mdx

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,20 @@ check out this [example plugin](https://github.com/PaperMC/paperweight-test-plug
1818
:::
1919

2020
## 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.
2624

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.
2830

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]
3332

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.
3835

3936
:::
4037

@@ -112,38 +109,39 @@ tasks.assemble {
112109

113110
## 1.20.5 and beyond
114111

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.
116113
Additionally, CraftBukkit classes will no longer be relocated into a versioned package.
117114
This requires plugins to be deobfuscated before loading when necessary.
118115

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.
120117

121118
### 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.
123121
* Spigot-mapped plugins will need to be deobfuscated on first load, Mojang-mapped plugins will not.
124122

125-
### Mojang mappings
123+
### Compiling to Mojang mappings
126124

127-
If you want to map your plugin with Mojang mappings, you need to add the following code to your build script:
125+
:::info
128126

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.
132130

133131
:::
134132

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:
134+
135135
```kotlin title="build.gradle.kts"
136136
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
137137
```
138138

139-
Additionally, you need to remove all `dependsOn(reobfJar)` lines.
139+
### Compiling to Spigot mappings
140140

141-
### Spigot mappings
142-
143-
If you are using Paper plugins but want to explicitly use Spigot mappings, you need to change the property to:
141+
If you want your main output to use Spigot mappings, add the following code to your build script:
144142

145143
```kotlin title="build.gradle.kts"
146144
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.REOBF_PRODUCTION
147145
```
148146

149-
147+
This is useful for plugins that have loaders for both Spigot and Paper and want to keep compatibility with both.

0 commit comments

Comments
 (0)