This also allows now to create custom packets with a custom packet id which is not in the packets.json
24 lines
511 B
Rust
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,
|
|
}
|
|
}
|
|
}
|