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: docssrc/src/setup_shading.md
-107Lines changed: 0 additions & 107 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,39 +107,6 @@ By default, the CommandAPI is written in the `dev.jorel.commandapi` package. It
107
107
108
108
-----
109
109
110
-
## A note about Paper 1.20.5+ servers
111
-
112
-
_If you are using the Spigot API, you can ignore this section and jump to [Shading with Maven](#shading-with-maven) or [Shading with Gradle](#shading-with-gradle)
113
-
depending on the build tool you use._
114
-
115
-
<divclass="warning">
116
-
117
-
**Developer's Note:**
118
-
119
-
Starting from Minecraft version 1.20.5, Paper will only ship mojang-mapped servers which use mojang-mapped class names and CraftBukkit classes without the version package.
120
-
However, when starting the server, Paper will remap Spigot-mapped plugins so that they can run on a mojang-mapped server.
121
-
122
-
At this time, the CommandAPI is not able to provide a version that runs on a mojang-mapped server without being relocated so your plugin has to be marked as Spigot-mapped
123
-
to make the server remap your plugin and your shaded CommandAPI version so that the CommandAPI is able to run on a 1.20.5 Paper server.
124
-
125
-
</div>
126
-
127
-
In the following section we distinguish between the use of the `Paper API`, in our context just the use of the `io.papermc.paper:paper-api:apiVersion` dependency
128
-
without Paper's internal code ("NMS"), and the use of `paperweight-userdev` (Paper's internal code) because the use of either of them will decide what you have to
129
-
do to make your plugin with the CommandAPI 1.20.5 Paper-compatible.
130
-
131
-
You now need to differentiate between certain configurations in order to make your plugin and the CommandAPI compatible with 1.20.5 servers:
132
-
133
-
| Build Tool | Paper | Plugin Flavour | What to do |
| Maven | Paper API |`plugin.yml`|[Shading with Maven](#shading-with-maven)|
136
-
| Maven | Paper API |`paper-plugin.yml`| <ol><li><ahref="#shading-with-maven">Shading with Maven<a/></li><li><ahref="#setting-the-manifest-value-maven">Setting the manifest value (Maven)</a></li></ol> |
137
-
| Gradle | Paper API |`plugin.yml`|[Shading with Gradle](#shading-with-gradle)|
138
-
| Gradle | Paper API |`paper-plugin.yml`| <ol><li><ahref="#shading-with-gradle">Shading with Gradle</a></li><li><ahref="#setting-the-manifest-value-gradle">Setting the manifest value (Gradle)</a></li></ol> |
139
-
| Gradle |`paperweight-userdev`|`plugin.yml`<br>`paper-plugin.yml`|[Shading with Gradle (`paperweight-userdev`)](#shading-with-gradle-paperweight-userdev)|
140
-
141
-
-----
142
-
143
110
## Shading with Maven
144
111
145
112
To shade the CommandAPI into a maven project, you'll need to use the `commandapi-bukkit-shade` dependency, which is optimized for shading and doesn't include plugin-specific files _(such as `plugin.yml`)_. **You do not need to use `commandapi-bukkit-core` if you are shading**:
@@ -292,77 +259,3 @@ gradlew build shadowJar
292
259
```
293
260
294
261
As we're shading the CommandAPI into your plugin, we **don't** need to add `depend: [CommandAPI]` to your `plugin.yml` file.
295
-
296
-
-----
297
-
298
-
## Setting the manifest value (Maven)
299
-
300
-
> **Developer's Note:**
301
-
>
302
-
> This step is only necessary when targeting Paper servers while using a `paper-plugin.yml`
303
-
304
-
In order to tell Paper that your plugin should be remapped to Mojang mappings at runtime, you have to set a manifest value in the `maven-jar-plugin`. This step is necessary as
305
-
Paper assumes that every plugin using a `paper-plugin.yml` already is mojang-mapped.
This will mark your plugin as Spigot-mapped and Paper will remap your plugin at runtime.
323
-
324
-
## Setting the manifest value (Gradle)
325
-
326
-
> **Developer's Note:**
327
-
>
328
-
> This step is only necessary when targeting Paper servers while using a `paper-plugin.yml`
329
-
330
-
In order to tell Paper that your plugin should be remapped to Mojang mappings at runtime, you have to set a manifest value in the `shadowJar` task. This step is necessary as
331
-
Paper assumes that every plugin using a `paper-plugin.yml` already is mojang-mapped.
This will mark your plugin as Spigot-mapped and Paper will remap your plugin at runtime.
342
-
343
-
## Shading with Gradle (`paperweight-userdev`)
344
-
345
-
> **Developer's Note:**
346
-
>
347
-
> This section assumes that you already have a project using `paperweight-userdev` set up.
348
-
349
-
<divclass="warning">
350
-
351
-
When using `paperweight-userdev`, building your plugin using the `shadowJar` task is not recommended since that task builds the mojang-mapped jar but does not remap any dependencies
352
-
you may have.
353
-
354
-
Because of that, the Paper server will see your plugin as mojang-mapped and will not try to remap your plugin resulting in a `NoClassDefFoundError` when calling the CommandAPI's
355
-
`onLoad` method because this uses the versioned CraftBukkit classes while a Paper server doesn't have those anymore.
356
-
357
-
</div>
358
-
359
-
Instead, please follow these instructions to be able to run the CommandAPI while having made your plugin using `paperweight-userdev`:
2. Only run the `reobfJar` task to build your plugin from now on. The main plugin artifact will be Spigot mapped andPaper will remap your plugin so that in the end
0 commit comments