chunkedge_protocol/packets/play/edit_book_c2s.rs
1use chunkedge_binary::{Bounded, Decode, Encode, VarInt};
2
3use crate::Packet;
4
5pub const MAX_TITLE_CHARS: usize = 32;
6pub const MAX_PAGE_CHARS: usize = 1024;
7pub const MAX_PAGES: usize = 100;
8
9#[derive(Clone, Debug, Encode, Decode, Packet)]
10pub struct EditBookC2s<'a> {
11 pub slot: VarInt,
12 pub entries: Bounded<Vec<Bounded<&'a str, MAX_PAGE_CHARS>>, MAX_PAGES>,
13 pub title: Option<Bounded<&'a str, MAX_TITLE_CHARS>>,
14}