Interface MessageFunctions.MessageEncoder<MSG>
- Type Parameters:
MSG
- the type of the message that is encoded
- Enclosing class:
- MessageFunctions
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface used to encode messages to a byte buffer.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
encode
(MSG message, FriendlyByteBuf buffer) Encodes the message to thebuffer
.
-
Method Details
-
encode
Encodes the message to thebuffer
.
This method is usually called as soon as the message is sent, so encoding usually happens on the client/server thread, not on the network thread.
However, that should not be relied on, and the encoder should try to be thread-safe, and to not interact with the game state.
-