Pumpkin/pumpkin-protocol/src/client/play/open_screen.rs
2025-02-23 13:35:22 +01:00

26 lines
566 B
Rust

use pumpkin_data::packet::clientbound::PLAY_OPEN_SCREEN;
use pumpkin_util::text::TextComponent;
use pumpkin_macros::packet;
use serde::Serialize;
use crate::VarInt;
#[derive(Serialize)]
#[packet(PLAY_OPEN_SCREEN)]
pub struct COpenScreen<'a> {
window_id: VarInt,
window_type: VarInt,
window_title: &'a TextComponent,
}
impl<'a> COpenScreen<'a> {
pub fn new(window_id: VarInt, window_type: VarInt, window_title: &'a TextComponent) -> Self {
Self {
window_id,
window_type,
window_title,
}
}
}