Pumpkin/pumpkin-protocol/src/client/login/c_plugin_request.rs
Alexander Medvedev 03e81a1436 transfer packet id parsing to build time
This also allows now to create custom packets with a custom packet id which is not in the packets.json
2025-01-10 13:42:39 +01:00

24 lines
511 B
Rust

use pumpkin_data::packet::clientbound::LOGIN_CUSTOM_QUERY;
use pumpkin_macros::client_packet;
use serde::Serialize;
use crate::VarInt;
#[derive(Serialize)]
#[client_packet(LOGIN_CUSTOM_QUERY)]
pub struct CLoginPluginRequest<'a> {
message_id: VarInt,
channel: &'a str,
data: &'a [u8],
}
impl<'a> CLoginPluginRequest<'a> {
pub fn new(message_id: VarInt, channel: &'a str, data: &'a [u8]) -> Self {
Self {
message_id,
channel,
data,
}
}
}