Skip to content

v1.0.4 — Zero-blocking packet dispatcher

Choose a tag to compare

@Namnarak Namnarak released this 24 Aug 08:47
· 13 commits to main since this release

ProtocolLib2PacketEvents v1.0.4

A production-focused dispatcher rewrite that removes the packet-thread blocking found during burst-login testing on Leaf 1.21.11.

Highlights

  • Zero-blocking packet dispatch: removes CountDownLatch.await(...) / blocking Future.get(...) from the PacketEvents hot path.
  • Correct ProtocolLib threading semantics: inbound packets stay on the network thread by default unless ListenerOptions.SYNC requests a main-thread hop; outbound listeners preserve ProtocolLib's main-thread default unless ASYNC opts out.
  • LOGIN_START compatibility: exposes the profile view expected by ProtocolLib-style login listeners using PacketEvents' username/UUID fields.
  • Per-packet listener indexes: packets with no matching listeners return without global listener scans or unnecessary container decoding.
  • Ordered continuations: thread hops are serialized per player/direction without blocking Netty event loops.
  • ByteBuf lifetime fix: deferred PacketEvents buffers now transfer ownership correctly to Netty, eliminating the IllegalReferenceCountException: refCnt: 0 regression seen in early 1.0.4 candidates.
  • Concurrency regression tests added for direction-sensitive threading and non-blocking dispatch behavior.

Production validation

Validated on Leaf 1.21.11 + Java 25 + PacketEvents 2.13.0:

  • 25-client burst: 25/25 spawned, 0 client errors, TPS remained ~20.
  • 50-client burst: P2P remained free of packet-listener timeout, ref-count, and watchdog-freeze errors; remaining failed joins were traced to the server's separate authentication/Mojang-profile pipeline rather than P2P.
  • Latest validated server logs contained 0 occurrences of:
    • Synchronous packet listener timed out
    • IllegalReferenceCountException
    • watchdog has not responded

Upgrade

Replace the previous P2P jar and perform a full server restart. Do not hot-reload packet/auth plugins in production.

P2P continues to advertise ProtocolLib API compatibility 5.4.0; the actual P2P release version is 1.0.4.

Artifact

ProtocolLib2PacketEvents-1.0.4.jar

SHA-256: 7b7433feb6e9fe3fb16e4666134524c03b91334a95548dd7c737395856560d18

See CHANGELOG.md for the full change list.