Interface SimpleMessage
- All Known Subinterfaces:
SimpleLoginMessage
- All Known Implementing Classes:
HandshakeMessages.C2SAcknowledge,HandshakeMessages.C2SModListReply,HandshakeMessages.LoginIndexedMessage,HandshakeMessages.S2CChannelMismatchData,HandshakeMessages.S2CConfigData,HandshakeMessages.S2CModData,HandshakeMessages.S2CModList,HandshakeMessages.S2CRegistry
public interface SimpleMessage
An abstraction for network packets.
-
Method Summary
Modifier and TypeMethodDescriptionvoidencode(FriendlyByteBuf buffer) Encodes this message to thebuffer.default voidhandleMainThread(NetworkEvent.Context context) Called on the server/client thread, in order to handle this packet.default voidhandleNetworkThread(NetworkEvent.Context context) Called on the network thread, in order to handle this packet.
-
Method Details
-
encode
Encodes this message to thebuffer.- See Also:
-
handleMainThread
Called on the server/client thread, in order to handle this packet. Accessing game state is safe here.- Parameters:
context- the network context
-
handleNetworkThread
Called on the network thread, in order to handle this packet. Accessing game state is not safe here, as the server is usually not thread-safe. Seriously, do NOT access the game state in this method.- Parameters:
context- the network context
-