Skip to content

Commit f8ddefa

Browse files
committed
fix ClientboundSetEquipment failing to deserialize if using animal armor slots
1 parent 26f3474 commit f8ddefa

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ is breaking anyways, semantic versioning is not followed.
3838
- The pathfinder now avoids magma blocks.
3939
- Fixed several panics, OOMs, and memory leaks in `azalea-protocol`.
4040
- Click events in chat messages were missing.
41+
- `ClientboundSetEquipment` failed to deserialize if a packet used animal armor slots.
4142

4243
## [0.15.1+mc1.21.11] - 2026-02-03
4344

azalea-inventory/src/components/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,8 @@ impl EquipmentSlot {
11321132
3 => Self::Legs,
11331133
4 => Self::Chest,
11341134
5 => Self::Head,
1135+
6 => Self::Body,
1136+
7 => Self::Saddle,
11351137
_ => return None,
11361138
};
11371139
Some(value)

azalea-protocol/src/packets/game/c_set_equipment.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,22 @@ impl AzBuf for EquipmentSlots {
5252
Ok(())
5353
}
5454
}
55+
56+
#[cfg(test)]
57+
mod tests {
58+
use std::io::Cursor;
59+
60+
use azalea_buf::AzBuf;
61+
62+
use super::*;
63+
64+
#[test]
65+
fn test_read_lifesteal_net_set_equipment() {
66+
let contents = [1, 128, 0, 129, 0, 130, 0, 131, 0, 132, 0, 133, 0, 7, 0];
67+
let mut buf = Cursor::new(contents.as_slice());
68+
let packet = ClientboundSetEquipment::azalea_read(&mut buf).unwrap();
69+
println!("{packet:?}");
70+
71+
assert_eq!(buf.position(), contents.len() as u64);
72+
}
73+
}

0 commit comments

Comments
 (0)