I'm trying to use the SimpleNetworkWrapper functionality to send information from the client to the server. I initialize the SimpleNetworkWrapper and then register the message handler, like so:
public static SimpleNetworkWrapper network;
network = new SimpleNetworkWrapper("Test");
network.registerMessage(PacketHandler.class, Request.class, 0, Side.SERVER);
I then call sendToServer() to send the information:
MyMod.network.sendToServer(new Request("Test"));
Request.class implements IMessage, and override toBytes() and fromBytes() to send data. However, the ByteBuffer that is passed to toBytes() is not the same as is passed to fromBytes(). The buffer in fromBytes() is always empty, no matter what is put into the buffer in toBytes(). Is this a bug or am I doing something wrong?