diff options
Diffstat (limited to 'azalea-protocol/src/packets/game')
| -rw-r--r-- | azalea-protocol/src/packets/game/c_container_set_slot.rs | 4 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/game/c_set_equipment.rs | 27 | ||||
| -rw-r--r-- | azalea-protocol/src/packets/game/c_update_attributes.rs | 2 |
3 files changed, 6 insertions, 27 deletions
diff --git a/azalea-protocol/src/packets/game/c_container_set_slot.rs b/azalea-protocol/src/packets/game/c_container_set_slot.rs index 73670439..571d8e82 100644 --- a/azalea-protocol/src/packets/game/c_container_set_slot.rs +++ b/azalea-protocol/src/packets/game/c_container_set_slot.rs @@ -6,8 +6,12 @@ use azalea_protocol_macros::ClientboundGamePacket; pub struct ClientboundContainerSetSlot { #[var] pub container_id: i32, + /// An identifier used by the server to track client inventory desyncs. #[var] pub state_id: u32, + /// The slot index. + /// + /// See https://minecraft.wiki/w/Java_Edition_protocol/Inventory. pub slot: u16, pub item_stack: ItemStack, } diff --git a/azalea-protocol/src/packets/game/c_set_equipment.rs b/azalea-protocol/src/packets/game/c_set_equipment.rs index b52672b0..0ef3d8e1 100644 --- a/azalea-protocol/src/packets/game/c_set_equipment.rs +++ b/azalea-protocol/src/packets/game/c_set_equipment.rs @@ -1,7 +1,7 @@ use std::io::{self, Cursor, Write}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; -use azalea_inventory::ItemStack; +use azalea_inventory::{ItemStack, components::EquipmentSlot}; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; @@ -54,28 +54,3 @@ impl AzaleaWrite for EquipmentSlots { Ok(()) } } - -#[derive(Clone, Debug, Copy, AzBuf, PartialEq)] -pub enum EquipmentSlot { - MainHand = 0, - OffHand = 1, - Feet = 2, - Legs = 3, - Chest = 4, - Head = 5, -} - -impl EquipmentSlot { - #[must_use] - pub fn from_byte(byte: u8) -> Option<Self> { - match byte { - 0 => Some(EquipmentSlot::MainHand), - 1 => Some(EquipmentSlot::OffHand), - 2 => Some(EquipmentSlot::Feet), - 3 => Some(EquipmentSlot::Legs), - 4 => Some(EquipmentSlot::Chest), - 5 => Some(EquipmentSlot::Head), - _ => None, - } - } -} diff --git a/azalea-protocol/src/packets/game/c_update_attributes.rs b/azalea-protocol/src/packets/game/c_update_attributes.rs index 39c921b0..d11b08cb 100644 --- a/azalea-protocol/src/packets/game/c_update_attributes.rs +++ b/azalea-protocol/src/packets/game/c_update_attributes.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; -use azalea_entity::attributes::AttributeModifier; +use azalea_inventory::components::AttributeModifier; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::Attribute; use azalea_world::MinecraftEntityId; |
