This object is created so often that it likely creates problems with the
ThreadLocalMap because the weak references can't be cleaned up fast
enough. This has manifest as lag seemingly caused by WorldEdit:
https://github.com/EngineHub/WorldEdit/issues/1668
Mojang made some changes to priorities in 1.17 and it seems that these changes
conflict with the changes made in this patch, which in some cases appears to
cause excessive rescheduling of tasks.
This, however, is not confirmed as such but seems to be the behavior that we're
seeing to cause this issue, if mojang has adopted the changes we suggested,
then a good chunk of this patch may be unneeded, but, this needs a much better
look than I'm currently able to do
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
e0598aa2 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter
CraftBukkit Changes:
2cdc6b1e4 SPIGOT-6692: Add sendSignChange overload with a hasGlowingText parameter
When a ServerEntity instance is first constructed, it uses a pre-Java 9 empty collection,
but passengers use Guava ImmutableList. When comparing the two collections via Object#equals
we miss out on an opportunity to reduce the check to little more than a reference equality
check (which is very fast).
The previously existing toBuilder method defined on the CraftMetaBook
would, no matter if called on a writable or written book, return a
builder targetting a writable book, in which complex components, such as
hover or click text are not allowed.
The builer hence serializes the page components using LEGACY_UXRC to
ensure only colour may be passed. While this works as intented for
writable books, the builder fails to fully support the complex
components that may be used in a written book.
This commit implemements a child class of the CraftMetaBookBuilder, the
CraftMetaBookSignedBuilder, which builds to a CraftMetaBookSigned
instance and hence serializes the pages to json.
This builder instance is automatically supplied when calling toBuilder
on a CraftMetaBookSigned instance.
Resolves: #6296