accept

abstract void accept(PacketContext context, PacketByteBuf buffer)

Receive a CustomPayload-based packet.

The PacketByteBuf received will be released as soon as the method exits,meaning that you have to call .retain()/.release() on it if you want tokeep it around after that.

Please keep in mind that this CAN be called OUTSIDE of the main thread!Most game operations are not thread-safe, so you should look into usingthe thread task queue (getTaskQueue) to splitthe "reading" (which should happen within this method's execution)and "applying" (which, unless you know what you're doing, should happenon the main thread, after this method exits).

Parameters

context

The context (receiving player, side, etc.)

buffer

The byte buffer containing the received packet data.

Sources

jvm source
Link copied to clipboard