Networking — custom packets as raw bytes over named channels.
Yog never puts NBT on the wire: a packet payload is just Vec<u8>, so mod
authors serialize with whatever is fastest for them (bincode, protobuf,
FlatBuffers, plain bytes). NBT is only ever built when something must be
handed to the game itself.
For ergonomic typed packets, use the [packet!] macro:
use ;
packet!
let pkt = TeleportPacket ;
let bytes = pkt.encode;
let decoded = decode.unwrap;
assert_eq!;