Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.promolitor.copymultiplayerworld.network;
- import cpw.mods.fml.common.network.simpleimpl.IMessage;
- import io.netty.buffer.ByteBuf;
- public class DataMessage implements IMessage {
- public byte[] data;
- public DataMessage() {
- }
- public DataMessage(byte[] data) {
- this.data = data;
- }
- @Override
- public void toBytes(ByteBuf buf) {
- // Writes the int into the buf
- buf.writeBytes(data);
- }
- @Override
- public void fromBytes(ByteBuf buf) {
- // Reads the int back from the buf. Note that if you have multiple
- // values, you must read in the same order you wrote.
- data = new byte[HOW BIG?]
- buf.readBytes(data);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement