REQ
- This is the request type - it is the message you expect to receive from remote.REPLY
- This is the reply type - it is the message you expect to send in reply. You can use IMessage as the type here
if you don't anticipate sending a reply.public interface IMessageHandler<REQ extends IMessage,REPLY extends IMessage>
IMessage
. Implement and override onMessage(IMessage, MessageContext)
to
process your packet. Supply the class to SimpleNetworkWrapper.registerMessage(Class, Class, int, net.minecraftforge.fml.relauncher.Side)
to register both the message type and it's associated handler.Modifier and Type | Method and Description |
---|---|
REPLY |
onMessage(REQ message,
MessageContext ctx)
Called when a message is received of the appropriate type.
|
REPLY onMessage(REQ message, MessageContext ctx)
message
- The message