PacketBundler

interface PacketBundler

Collects multiple packets to be sent together to a player.

This helps optimize network traffic by grouping related updates (e.g., bone movements) into a single bundle or batch.

Since

1.15.2

Functions

Link copied to clipboard
abstract fun isEmpty(): Boolean
Checks if the bundler contains no packets.
Link copied to clipboard
open fun isNotEmpty(): Boolean
Checks if the bundler contains at least one packet.
Link copied to clipboard
open fun send(@NotNull player: @NotNull PlatformPlayer)
Sends all collected packets to the specified player.
abstract fun send(@NotNull player: @NotNull PlatformPlayer, @NotNull onSuccess: @NotNull Runnable)
Sends all collected packets to the specified player and executes a callback on success.
Link copied to clipboard
abstract fun size(): Int
Returns the number of packets in the bundler.