valence_protocol/packets/play/book_update_c2s.rs
1use crate::{Bounded, Decode, Encode, Packet, VarInt};
2
3pub const MAX_TITLE_CHARS: usize = 128;
4pub const MAX_PAGE_CHARS: usize = 8192;
5pub const MAX_PAGES: usize = 200;
6
7#[derive(Clone, Debug, Encode, Decode, Packet)]
8pub struct BookUpdateC2s<'a> {
9 pub slot: VarInt,
10 pub entries: Bounded<Vec<Bounded<&'a str, MAX_PAGE_CHARS>>, MAX_PAGES>,
11 pub title: Option<Bounded<&'a str, MAX_TITLE_CHARS>>,
12}