Skip to content

Bukkit - Update MinecraftComponentSerializer for 1.21.6/7 #212

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bloodmc
Copy link

@bloodmc bloodmc commented Jun 28, 2025

This PR adds support for Minecraft 1.21.6 by integrating the new ComponentSerialization.CODEC for component serialization, while preserving compatibility with older versions.

@bloodmc
Copy link
Author

bloodmc commented Jun 30, 2025

Works on Paper 1.21.6 but not fully on Spigot. I'll push a fix when I can.

@bloodmc
Copy link
Author

bloodmc commented Jun 30, 2025

Spigot works properly now. The core.HolderLookup$Provider class isn't remapped on Spigot and uses the obf name core.HolderLookup$a.

@bloodmc
Copy link
Author

bloodmc commented Jun 30, 2025

Cached JsonOps.INSTANCE via reflection to avoid repeated class and field lookups. PR should be ready for pull now.

@AnttiMK
Copy link

AnttiMK commented Jun 30, 2025

@bloodmc Checkstyle is failing, probably want the build to pass before merging 😅

@jpenilla jpenilla changed the title 1.21.6 support for platform-bukkit Bukkit - Update MinecraftComponentSerializer for 1.21.6/7 Jul 2, 2025
Copy link
Member

@jpenilla jpenilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrfloris

This comment was marked as spam.

@nossr50
Copy link

nossr50 commented Jul 6, 2025

I've tested this PR in mcMMO and it is working with Paper 1.21.7 builds, hover components and action bar messages are now being sent correctly.

@andrewkm
Copy link

andrewkm commented Jul 7, 2025

Waiting for this on our end as well; currently testing the PR with some custom builds and going well. :)

Copy link

@AnttiMK AnttiMK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've (smoke-)tested this PR alongside Adventure 4.23.0 on the currently "most popular" versions of Spigot and Paper (latest builds of 1.8.8, 1.12.2, 1.16.5, 1.18.2, 1.19.4, 1.20.6 and 1.21.7), and didn't notice any issues. My testing included whether MinecraftComponentSerializer#isSupported() evaluates to true, and that (de)serialization works by checking that the following snippet produces working components:

Component adventureComponent = text("Hello, Adventure!", RED, BOLD);
Object nmsComponent = MinecraftComponentSerializer.get().serialize(adventureComponent);
Component deserializedComponent = MinecraftComponentSerializer.get().deserialize(nmsComponent);

I also threw this into production with Paper 1.21.7 and Citizens (CitizensDev/Citizens2@1049ca6), and didn't notice any issues.

@kezz
Copy link
Member

kezz commented Jul 10, 2025

Just for reference for those of you following this PR:

  • The PR itself appears to be functional, you are more than welcome to manually include it in your code/plugin/project if you need to.
  • We have some issues at the moment relating to the recent publishing changes that are currently blocking this PR from being merged that will be worked on when we have time.

We appreciate your patience 💪

@nossr50

This comment was marked as spam.

@Dawsson

This comment was marked as spam.

@KyoriPowered KyoriPowered locked as spam and limited conversation to collaborators Jul 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants