aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-09-07 22:12:16 -0500
committermat <github@matdoes.dev>2022-09-07 22:12:16 -0500
commit98000f800f31c85c7bbf121b116047137b503c49 (patch)
tree720e21b59e1b10eed6e66b6ace06714407d68f54 /azalea-protocol/src
parentec316e02cd7d86829614ec1c0b7e3edadad103c5 (diff)
downloadazalea-drasl-98000f800f31c85c7bbf121b116047137b503c49.tar.xz
why am i getting a varint error
Diffstat (limited to 'azalea-protocol/src')
-rw-r--r--azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs
index 7192f88a..5d3bdd23 100644
--- a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs
+++ b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs
@@ -14,7 +14,7 @@ pub struct ClientboundPlayerChatPacket {
pub chat_type: ChatTypeBound,
}
-#[derive(Copy, Clone, Debug, McBuf)]
+#[derive(Copy, Clone, Debug, McBuf, PartialEq, Eq)]
pub enum ChatType {
Chat = 0,
SayCommand = 1,
@@ -115,3 +115,15 @@ impl McBufWritable for FilterMask {
Ok(())
}
}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ #[test]
+ fn test_chat_type() {
+ let chat_type_enum = ChatType::read_from(&mut &[0x06][..]).unwrap();
+ assert_eq!(chat_type_enum, ChatType::EmoteCommand);
+ assert!(ChatType::read_from(&mut &[0x07][..]).is_err());
+ }
+}