Skip to content

Move away from final field mutations#85

Merged
MrMicky-FR merged 5 commits into
MrMicky-FR:masterfrom
syldium:final-field-mutation
Jun 20, 2026
Merged

Move away from final field mutations#85
MrMicky-FR merged 5 commits into
MrMicky-FR:masterfrom
syldium:final-field-mutation

Conversation

@syldium

@syldium syldium commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Implements #84. This also adds compatibility for Minecraft 26.2-pre4 as it changes the serializable team class (ClientboundSetPlayerTeamPacket$Parameters) to be a record, making final field mutation impossible.

The most significant change is that the ClientboundSetObjectivePacket packet is now constructed with a Objective NMS object. Instanciation of the ClientboundSetDisplayObjectivePacket and ClientboundSetPlayerTeamPacket classes has been adapted to prefer their constructors.

This change also involves changing how older versions create their packets, therefore requiring extensive tests against numerous versions. So far, it has been tested with:

  • Paper's dev/26.2 branch, Java 26
  • Paper 26.1.2, Java 26
  • Spigot 1.13.2, Java 11
  • Spigot 1.8.3, Java 8

@MrMicky-FR MrMicky-FR added the enhancement New feature or request label Jun 12, 2026
@MrMicky-FR

Copy link
Copy Markdown
Owner

Hi,

Thanks a lot for this update! Tested on 1.7.10, 1.8.8, 1.12.2, 1.13.2, 1.16.5, 1.17.1, 1.21.1, 1.21.11 and 26.1 and seems to work perfectly 🚀

I was thinking of merging this once the 26.2 release drops, but open to doing it before :)

@MrMicky-FR

Copy link
Copy Markdown
Owner

Hi, 26.2 was just released, it seems to work fine, is this ready to release or more testing is required? Thanks!

@syldium

syldium commented Jun 19, 2026

Copy link
Copy Markdown
Contributor Author

It's ready for merge; I don't have any more changes planned.

@MrMicky-FR
MrMicky-FR merged commit 40408da into MrMicky-FR:master Jun 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants