Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions azalea-protocol/src/common/recipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ use azalea_registry::{
identifier::Identifier,
};

/// A recipe display id (`RecipeDisplayId`), serialized as a VarInt.
///
/// Since 1.21.2 `ServerboundPlaceRecipe`'s second field is a `RecipeDisplayId`, not a
/// `ResourceLocation`/`Identifier` string.
#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub struct RecipeDisplayId(#[var] pub u32);

/// [`azalea_registry::builtin::RecipeDisplay`]
#[derive(AzBuf, Clone, Debug, PartialEq)]
pub enum RecipeDisplayData {
Expand Down
4 changes: 2 additions & 2 deletions azalea-protocol/src/packets/game/s_place_recipe.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use azalea_buf::AzBuf;
use azalea_registry::identifier::Identifier;
use crate::common::recipe::RecipeDisplayId;
use azalea_protocol_macros::ServerboundGamePacket;

#[derive(AzBuf, Clone, Debug, PartialEq, ServerboundGamePacket)]
pub struct ServerboundPlaceRecipe {
#[var]
pub container_id: i32,
pub recipe: Identifier,
pub recipe: RecipeDisplayId,
pub shift_down: bool,
}