azalea_protocol/packets/game/
c_set_entity_data.rs1use azalea_buf::AzBuf;
2use azalea_entity::EntityMetadataItems;
3use azalea_protocol_macros::ClientboundGamePacket;
4use azalea_world::MinecraftEntityId;
5
6#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)]
7pub struct ClientboundSetEntityData {
8 #[var]
9 pub id: MinecraftEntityId,
10 pub packed_items: EntityMetadataItems,
11}
12
13#[cfg(test)]
14mod tests {
15 use std::io::Cursor;
16
17 use azalea_buf::AzaleaRead;
18
19 use super::*;
20
21 #[test]
22 fn test_read_6b6t_entity_data() {
23 let contents = [
24 254, 180, 160, 8, 11, 33, 190, 230, 102, 102, 0, 0, 0, 0, 191, 0, 0, 0, 12, 33, 63,
25 102, 102, 102, 63, 25, 153, 154, 63, 102, 102, 102, 23, 14, 234, 64, 255,
26 ];
27 let mut buf = Cursor::new(contents.as_slice());
28 let packet = ClientboundSetEntityData::azalea_read(&mut buf).unwrap();
29 println!("{packet:?}");
30
31 assert_eq!(buf.position(), contents.len() as u64);
32 }
33}