azalea_protocol/packets/game/
c_recipe_book_add.rs

1use azalea_buf::AzBuf;
2use azalea_protocol_macros::ClientboundGamePacket;
3
4use crate::common::recipe::{Ingredient, RecipeDisplayData};
5
6#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)]
7pub struct ClientboundRecipeBookAdd {
8    pub entries: Vec<Entry>,
9    pub replace: bool,
10}
11
12#[derive(Clone, Debug, AzBuf)]
13pub struct Entry {
14    pub contents: RecipeDisplayEntry,
15    pub flags: u8,
16}
17
18#[derive(Clone, Debug, AzBuf)]
19pub struct RecipeDisplayEntry {
20    #[var]
21    pub id: u32,
22    pub display: RecipeDisplayData,
23    // optional varint
24    #[var]
25    pub group: u32,
26    pub category: azalea_registry::RecipeBookCategory,
27    pub crafting_requirements: Option<Vec<Ingredient>>,
28}