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>
* Improve documentation for priority parameter in EventManager
PostOrder was deprecated in commit
(4f227badc2) in favor of priorities.
PostOrder itself was very descriptive on which PostOrder is processed first. A number cannot be descriptive about that - it is never clear if higher or lower numbers are processed first.
The Subscribe event attribute does contain a description on how priorities are evaluated. The EventManager did not, which literally did confused developers manually registering events.
This commit fixes this by describing the priority argument in EventManager with the same description that Subscribe uses.
* Fixed checkstyle
---------
Co-authored-by: Adrian Gonzales <adriangonzalesval@gmail.com>
* Fix Gradle deprecations
By using test suites, we explicitely configure the relevant dependencies
on the test sourceset. This is not done by merely configuring the test task.
* Switch to maintained version of Shadow
* Update to Gradle 8.14.2