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