aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2026-02-04 03:50:35 +0400
committermat <git@matdoes.dev>2026-02-04 03:50:35 +0400
commitf8ddefa70cc53e6385785fb56e7a688a389cf0ab (patch)
tree1aeb54c20bddb542d0b70430ebb00563d0627298 /azalea-protocol
parent26f3474f835a586af8b4383fdc9b83ebc54da299 (diff)
downloadazalea-drasl-f8ddefa70cc53e6385785fb56e7a688a389cf0ab.tar.xz
fix ClientboundSetEquipment failing to deserialize if using animal armor slots
Diffstat (limited to 'azalea-protocol')
-rw-r--r--azalea-protocol/src/packets/game/c_set_equipment.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/azalea-protocol/src/packets/game/c_set_equipment.rs b/azalea-protocol/src/packets/game/c_set_equipment.rs
index 11ee8b3a..15856ad7 100644
--- a/azalea-protocol/src/packets/game/c_set_equipment.rs
+++ b/azalea-protocol/src/packets/game/c_set_equipment.rs
@@ -52,3 +52,22 @@ impl AzBuf for EquipmentSlots {
Ok(())
}
}
+
+#[cfg(test)]
+mod tests {
+ use std::io::Cursor;
+
+ use azalea_buf::AzBuf;
+
+ use super::*;
+
+ #[test]
+ fn test_read_lifesteal_net_set_equipment() {
+ let contents = [1, 128, 0, 129, 0, 130, 0, 131, 0, 132, 0, 133, 0, 7, 0];
+ let mut buf = Cursor::new(contents.as_slice());
+ let packet = ClientboundSetEquipment::azalea_read(&mut buf).unwrap();
+ println!("{packet:?}");
+
+ assert_eq!(buf.position(), contents.len() as u64);
+ }
+}