Recent Netty versions have improved the adaptive allocator, and we shouldn't be seeing the OOM issues others were noticing before. Let's re-enable it.
As for the buffer resizing issue, the upstream issue netty/netty#14912 is long fixed. I think we *should* pre-allocate the buffers beforehand much more aggressively, but that has to be future work.
No need to bounce around changing the writer index, we can just set the value directly.
Also pull out the handshake checks into a separate function, to improve inlining.
* Fix 1.20.2+ clients disconnecting when updating boss bars
On 1.20.2, the Minecraft client started clearing boss bars after the login packet, which meant that the ProxyServer#showBossbar API would result in the player getting kicked if the boss bar they were previously shown was updated after switching servers.
Therefore, I have added BossBarManager which drops boss bar packets once the client enters the configure phase to ensure that they do not disconnect, and then re-adds the boss bar once the client enters the login phase.
This ensures that clients do not receive boss bar updates for boss bars that they don't exist and causing them to disconnect. I have also taken care to ensure that this logic only applies on 1.20.2 and up, as it is not necessary for older clients.
---------
Co-authored-by: Adrian Gonzales <adriangonzalesval@gmail.com>
* feat: Add primitive support for sound api
* change to fail silently
fix: implement the correct playSound method
fix: bumped "since" version
* chore: update 1.21.5
* chore: enforce adventure's policy of not throwing exceptions on unsupported actions
* feat: allow sounds to be played from other players (on the same server)
* chore(fix): add missing getters/setters in packets
* chore: update 1.21.6
chore: added own notes to playSound method, as adventure moved them to the Sound class
* chore: cleanup
* fix: ignore invalid sound source
fix: sound source error on wrong version
* chore: prettify key writing
* Implement missing Player#playSound(Sound)
* Reverted Player#playSound(Sound) implementation
Also, improved documentation related to #playSound mehtods
* chore(jd): mark dialog operations unsupported
* chore: update 1.21.9
---------
Co-authored-by: Adrian Gonzales <adriangonzalesval@gmail.com>
* fix: Don't ignore the player's locale in message translation
* feature: Use PointersSupplier to save constructing a Pointers instance for every player
* fix: Don't use a custom implementation of Identity for players
We don't need to carry about this object for every player.
* chore: Stop using deprecated TranslationRegistry
* fix: Simplify TranslatableMapper and fix bugs
- The fallback string is not intended to be translated, so don't do that.
- Check if the string can be translated in the default locale before using the closest mapper as devs may have their own strings.
- Remove the hardcoded check for TranslationRegistry instance as devs (and us now) can use non-TranslationRegistry translator instances.