Pumpkin/pumpkin-protocol/src/client/play/c_set_title.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

18 lines
386 B
Rust

use pumpkin_data::packet::clientbound::PLAY_SET_TITLE_TEXT;
use pumpkin_util::text::TextComponent;
use pumpkin_macros::client_packet;
use serde::Serialize;
#[derive(Serialize)]
#[client_packet(PLAY_SET_TITLE_TEXT)]
pub struct CTitleText<'a> {
title: &'a TextComponent,
}
impl<'a> CTitleText<'a> {
pub fn new(title: &'a TextComponent) -> Self {
Self { title }
}
}