-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested
Description
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>
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is neededquestionFurther information is requestedFurther information is requested