diff options
| author | mat <git@matdoes.dev> | 2024-04-20 21:05:51 +0000 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2024-04-20 21:06:37 +0000 |
| commit | 0ddad8bd9c7c0e8846aec8bc90c95416418c9a63 (patch) | |
| tree | 4f19bea48546d830b8a5a13ffb797ebd7c1ced49 /azalea-protocol/src | |
| parent | f919fb65d67891d2eb6e302ea400743963c4c550 (diff) | |
| download | azalea-drasl-0ddad8bd9c7c0e8846aec8bc90c95416418c9a63.tar.xz | |
fix edge case with reading FormattedText as nbt
Diffstat (limited to 'azalea-protocol/src')
| -rwxr-xr-x | azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs index 420dfd36..691a62a1 100755 --- a/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs @@ -29,4 +29,17 @@ mod tests { "[py5: Gave 1 [Diamond Pickaxe] to py5]".to_string() ); } + + #[test] + fn test_translate_with_string_array_clientbound_system_chat_packet() { + #[rustfmt::skip] + let bytes = [ + 10, 9, 0, 4, 119, 105, 116, 104, 8, 0, 0, 0, 1, 0, 14, 109, 105, 110, 101, 99, 114, 97, 102, 116, 58, 100, 117, 115, 116, 8, 0, 9, 116, 114, 97, 110, 115, 108, 97, 116, 101, 0, 25, 99, 111, 109, 109, 97, 110, 100, 115, 46, 112, 97, 114, 116, 105, 99, 108, 101, 46, 115, 117, 99, 99, 101, 115, 115, 0, 0 + ]; + let packet = ClientboundSystemChatPacket::read_from(&mut Cursor::new(&bytes)).unwrap(); + assert_eq!( + packet.content.to_string(), + "Displaying particle minecraft:dust".to_string() + ); + } } |
