aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-03-13 20:52:29 +0000
committermat <git@matdoes.dev>2025-03-13 20:52:29 +0000
commit249fa55a53d3011cd0223c0dc5673e9a7b81db8e (patch)
tree4bb2b090c245660d36525605443684ded7fa7584
parent65fe07215149ab81d0862ab7edac71d6a8417ef8 (diff)
downloadazalea-drasl-249fa55a53d3011cd0223c0dc5673e9a7b81db8e.tar.xz
fix wrong Potion data component
-rw-r--r--azalea-inventory/src/components.rs1
-rwxr-xr-xazalea-protocol/src/packets/game/c_set_entity_data.rs17
2 files changed, 18 insertions, 0 deletions
diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs
index 2ff00d5b..1d92faf3 100644
--- a/azalea-inventory/src/components.rs
+++ b/azalea-inventory/src/components.rs
@@ -512,6 +512,7 @@ pub struct PotionContents {
pub potion: Option<Potion>,
pub custom_color: Option<i32>,
pub custom_effects: Vec<MobEffectInstance>,
+ pub custom_name: Option<String>,
}
impl DataComponent for PotionContents {
const KIND: DataComponentKind = DataComponentKind::PotionContents;
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 fb77163b..a7042417 100755
--- a/azalea-protocol/src/packets/game/c_set_entity_data.rs
+++ b/azalea-protocol/src/packets/game/c_set_entity_data.rs
@@ -31,4 +31,21 @@ mod tests {
packet.write(&mut buf).unwrap();
assert_eq!(buf, contents);
}
+
+ #[test]
+ fn test_read_hypixel_entity_data_2() {
+ let contents = [
+ 161, 21, 2, 6, 0, 5, 8, 0, 6, 21, 0, 7, 1, 0, 1, 1, 172, 2, 3, 8, 0, 4, 8, 0, 9, 1, 0,
+ 0, 0, 0, 8, 7, 1, 186, 9, 2, 0, 5, 10, 9, 0, 5, 101, 120, 116, 114, 97, 10, 0, 0, 0, 1,
+ 8, 0, 5, 99, 111, 108, 111, 114, 0, 9, 100, 97, 114, 107, 95, 97, 113, 117, 97, 1, 0,
+ 4, 98, 111, 108, 100, 1, 8, 0, 4, 116, 101, 120, 116, 0, 18, 67, 108, 111, 117, 100,
+ 32, 82, 101, 103, 101, 110, 101, 114, 97, 116, 105, 111, 110, 0, 8, 0, 4, 116, 101,
+ 120, 116, 0, 0, 1, 0, 6, 105, 116, 97, 108, 105, 99, 0, 0, 41, 1, 31, 0, 0, 0, 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);
+ }
}