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.
See Also:
  • Method Details

    • encode

      void encode(FriendlyByteBuf buffer)
      Encodes this message to the buffer.
      See Also:
    • handleMainThread

      default void handleMainThread(NetworkEvent.Context context)
      Called on the server/client thread, in order to handle this packet. Accessing game state is safe here.
      Parameters:
      context - the network context
    • handleNetworkThread

      default void handleNetworkThread(NetworkEvent.Context context)
      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