From ef25e77e5262c68c682d889bc58e7120c66f978a Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 29 Jan 2025 02:00:44 +0000 Subject: add data for EntityEffect particle to fix set_entity_data errors on hypixel --- .../src/packets/game/c_set_entity_data.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'azalea-protocol/src') diff --git a/azalea-protocol/src/packets/game/c_set_entity_data.rs b/azalea-protocol/src/packets/game/c_set_entity_data.rs index da6536fe..769c2edf 100755 --- a/azalea-protocol/src/packets/game/c_set_entity_data.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_data.rs @@ -8,3 +8,26 @@ pub struct ClientboundSetEntityData { pub id: u32, pub packed_items: EntityMetadataItems, } + +#[cfg(test)] +mod tests { + use std::io::Cursor; + + use azalea_buf::AzaleaRead; + + use super::*; + + #[test] + fn test_read_write_container_set_content() { + let contents = [161, 226, 1, 10, 18, 1, 20, 38, 124, 175, 198, 255]; + let mut buf = Cursor::new(contents.as_slice()); + let packet = ClientboundSetEntityData::azalea_read(&mut buf).unwrap(); + println!("{:?}", packet); + + assert_eq!(buf.position(), contents.len() as u64); + + let mut buf = Vec::new(); + packet.write(&mut buf).unwrap(); + assert_eq!(buf, contents); + } +} -- cgit v1.2.3