Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions docs/paper/dev/misc/internal-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ of Paper. This is unlikely to be the case in most production environments. This
include the version. For example, `org.bukkit.craftbukkit.v1_20_R2.CraftServer` is the full class and package name
for the CraftServer class in version 1.20.2. You can access these classes easily with some reflection utilities.

:::warning[Removal of relocation in 1.20.5]

As of 1.20.5, the versioned relocation of the CraftBukkit package was removed and
CraftBukkit packages are now located in `org.bukkit.craftbukkit` and not in `org.bukkit.craftbukkit.<version>`.

:::

```java
private static final String CRAFTBUKKIT_PACKAGE = Bukkit.getServer().getClass().getPackage().getName();

Expand All @@ -67,6 +74,13 @@ it makes the code easier to understand.

### Mojang-Mapped Servers

:::info[Mojang-mapped runtime as of 1.20.5]

As of 1.20.5, Paper ships with a Mojang-mapped runtime instead of reobfuscating the server to Spigot mappings.
For more information, see the [plugin remapping](./project-setup#plugin-remapping) section and [userdev](./userdev#1205-and-beyond) documentation covering these changes.

:::

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
Expand Down Expand Up @@ -95,7 +109,7 @@ int dataVersion = Bukkit.getUnsafe().getDataVersion();

:::danger[Parsing the version]

You should not parse the version from the package name of classes. This is because CraftBukkit may not be relocated
in the future.
Parsing the version from the package name of classes is no longer possible as of 1.20.5 as Paper stopped relocating the CraftBukkit package.
See the [reflection](#reflection) section for more information.

:::