Issue / Question:
We should utilize rust Macros.
Relevance:
Rust macros would save us time when writing protocol implementation, for instance, instead of repeatedly writing implementations for ProtocolEncoder/Decoder we can utilize macros, which will be able to do this for us.
Solution:
#[mcpe_packet(1)]
pub struct LoginPacket {
pub protocol: u8;
pub data: BinaryStream;
}
or more advanced:
#[derive(encoder, decoder)]
pub struct BehaviorPack {
... props
}
#[mcpe_packet(7, "custom")]
pub struct ResourcePacksInfo {
pub required: bool,
pub has_scripts: bool,
pub bpacks: Vec<BehaviorPack>
}
Issue / Question:
We should utilize rust Macros.
Relevance:
Rust macros would save us time when writing protocol implementation, for instance, instead of repeatedly writing implementations for ProtocolEncoder/Decoder we can utilize macros, which will be able to do this for us.
Solution:
or more advanced: