diff options
Diffstat (limited to 'azalea-protocol/src/packets')
246 files changed, 366 insertions, 505 deletions
diff --git a/azalea-protocol/src/packets/common.rs b/azalea-protocol/src/packets/common.rs index ab9c46b4..ad87fa8d 100644 --- a/azalea-protocol/src/packets/common.rs +++ b/azalea-protocol/src/packets/common.rs @@ -8,7 +8,7 @@ use azalea_core::{ }; use tracing::error; -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct CommonPlayerSpawnInfo { pub dimension_type: azalea_registry::DimensionType, pub dimension: ResourceLocation, diff --git a/azalea-protocol/src/packets/config/c_clear_dialog.rs b/azalea-protocol/src/packets/config/c_clear_dialog.rs index 7114cc28..a4945516 100644 --- a/azalea-protocol/src/packets/config/c_clear_dialog.rs +++ b/azalea-protocol/src/packets/config/c_clear_dialog.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] -pub struct ClientboundClearDialog {} +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] +pub struct ClientboundClearDialog; diff --git a/azalea-protocol/src/packets/config/c_cookie_request.rs b/azalea-protocol/src/packets/config/c_cookie_request.rs index 4c57718d..c1a42cac 100644 --- a/azalea-protocol/src/packets/config/c_cookie_request.rs +++ b/azalea-protocol/src/packets/config/c_cookie_request.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundCookieRequest { pub key: ResourceLocation, } diff --git a/azalea-protocol/src/packets/config/c_custom_payload.rs b/azalea-protocol/src/packets/config/c_custom_payload.rs index 3432ac3a..19335264 100644 --- a/azalea-protocol/src/packets/config/c_custom_payload.rs +++ b/azalea-protocol/src/packets/config/c_custom_payload.rs @@ -1,9 +1,8 @@ -use azalea_buf::AzBuf; -use azalea_buf::UnsizedByteArray; +use azalea_buf::{AzBuf, UnsizedByteArray}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundCustomPayload { pub identifier: ResourceLocation, pub data: UnsizedByteArray, diff --git a/azalea-protocol/src/packets/config/c_custom_report_details.rs b/azalea-protocol/src/packets/config/c_custom_report_details.rs index 5fa375d0..38209dd8 100644 --- a/azalea-protocol/src/packets/config/c_custom_report_details.rs +++ b/azalea-protocol/src/packets/config/c_custom_report_details.rs @@ -1,9 +1,8 @@ -use std::collections::HashMap; - use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; +use indexmap::IndexMap; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundCustomReportDetails { - pub details: HashMap<String, String>, + pub details: IndexMap<String, String>, } diff --git a/azalea-protocol/src/packets/config/c_disconnect.rs b/azalea-protocol/src/packets/config/c_disconnect.rs index b59b318d..37915b38 100644 --- a/azalea-protocol/src/packets/config/c_disconnect.rs +++ b/azalea-protocol/src/packets/config/c_disconnect.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundDisconnect { pub reason: FormattedText, } diff --git a/azalea-protocol/src/packets/config/c_finish_configuration.rs b/azalea-protocol/src/packets/config/c_finish_configuration.rs index ea6e6d27..2cfe64fd 100644 --- a/azalea-protocol/src/packets/config/c_finish_configuration.rs +++ b/azalea-protocol/src/packets/config/c_finish_configuration.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundFinishConfiguration; diff --git a/azalea-protocol/src/packets/config/c_keep_alive.rs b/azalea-protocol/src/packets/config/c_keep_alive.rs index f0310c34..575ff52e 100644 --- a/azalea-protocol/src/packets/config/c_keep_alive.rs +++ b/azalea-protocol/src/packets/config/c_keep_alive.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundKeepAlive { pub id: u64, } diff --git a/azalea-protocol/src/packets/config/c_ping.rs b/azalea-protocol/src/packets/config/c_ping.rs index 35b5c39c..82a83692 100644 --- a/azalea-protocol/src/packets/config/c_ping.rs +++ b/azalea-protocol/src/packets/config/c_ping.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundPing { pub id: u32, } diff --git a/azalea-protocol/src/packets/config/c_registry_data.rs b/azalea-protocol/src/packets/config/c_registry_data.rs index 5b43413d..18d2e73b 100644 --- a/azalea-protocol/src/packets/config/c_registry_data.rs +++ b/azalea-protocol/src/packets/config/c_registry_data.rs @@ -3,7 +3,7 @@ use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; use simdnbt::owned::NbtCompound; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundRegistryData { pub registry_id: ResourceLocation, pub entries: Vec<(ResourceLocation, Option<NbtCompound>)>, diff --git a/azalea-protocol/src/packets/config/c_reset_chat.rs b/azalea-protocol/src/packets/config/c_reset_chat.rs index 273cb0fd..bd15a79e 100644 --- a/azalea-protocol/src/packets/config/c_reset_chat.rs +++ b/azalea-protocol/src/packets/config/c_reset_chat.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundResetChat; diff --git a/azalea-protocol/src/packets/config/c_resource_pack.rs b/azalea-protocol/src/packets/config/c_resource_pack.rs deleted file mode 100644 index 63a59b5b..00000000 --- a/azalea-protocol/src/packets/config/c_resource_pack.rs +++ /dev/null @@ -1,11 +0,0 @@ -use azalea_buf::AzBuf; -use azalea_chat::FormattedText; -use azalea_protocol_macros::ClientboundConfigPacket; - -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] -pub struct ClientboundResourcePack { - pub url: String, - pub hash: String, - pub required: bool, - pub prompt: Option<FormattedText>, -} diff --git a/azalea-protocol/src/packets/config/c_resource_pack_pop.rs b/azalea-protocol/src/packets/config/c_resource_pack_pop.rs index f949a726..2df9f375 100644 --- a/azalea-protocol/src/packets/config/c_resource_pack_pop.rs +++ b/azalea-protocol/src/packets/config/c_resource_pack_pop.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundResourcePackPop { pub id: Option<Uuid>, } diff --git a/azalea-protocol/src/packets/config/c_resource_pack_push.rs b/azalea-protocol/src/packets/config/c_resource_pack_push.rs index 6be5c709..257cb374 100644 --- a/azalea-protocol/src/packets/config/c_resource_pack_push.rs +++ b/azalea-protocol/src/packets/config/c_resource_pack_push.rs @@ -3,7 +3,7 @@ use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundConfigPacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundResourcePackPush { pub id: Uuid, pub url: String, diff --git a/azalea-protocol/src/packets/config/c_select_known_packs.rs b/azalea-protocol/src/packets/config/c_select_known_packs.rs index 6a4f76db..c8b17413 100644 --- a/azalea-protocol/src/packets/config/c_select_known_packs.rs +++ b/azalea-protocol/src/packets/config/c_select_known_packs.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundConfigPacket; use super::s_select_known_packs::KnownPack; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundSelectKnownPacks { pub known_packs: Vec<KnownPack>, } diff --git a/azalea-protocol/src/packets/config/c_server_links.rs b/azalea-protocol/src/packets/config/c_server_links.rs index 3420e592..e459e901 100644 --- a/azalea-protocol/src/packets/config/c_server_links.rs +++ b/azalea-protocol/src/packets/config/c_server_links.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundConfigPacket; use crate::common::server_links::ServerLinkEntry; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundServerLinks { pub links: Vec<ServerLinkEntry>, } diff --git a/azalea-protocol/src/packets/config/c_show_dialog.rs b/azalea-protocol/src/packets/config/c_show_dialog.rs index aacc2816..7d1ad498 100644 --- a/azalea-protocol/src/packets/config/c_show_dialog.rs +++ b/azalea-protocol/src/packets/config/c_show_dialog.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; use simdnbt::owned::Nbt; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundShowDialog { pub dialog: Nbt, } diff --git a/azalea-protocol/src/packets/config/c_store_cookie.rs b/azalea-protocol/src/packets/config/c_store_cookie.rs index c52211ea..5fa03729 100644 --- a/azalea-protocol/src/packets/config/c_store_cookie.rs +++ b/azalea-protocol/src/packets/config/c_store_cookie.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundStoreCookie { pub key: ResourceLocation, pub payload: Vec<u8>, diff --git a/azalea-protocol/src/packets/config/c_transfer.rs b/azalea-protocol/src/packets/config/c_transfer.rs index 332421d8..db0e846a 100644 --- a/azalea-protocol/src/packets/config/c_transfer.rs +++ b/azalea-protocol/src/packets/config/c_transfer.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundTransfer { pub host: String, #[var] diff --git a/azalea-protocol/src/packets/config/c_update_enabled_features.rs b/azalea-protocol/src/packets/config/c_update_enabled_features.rs index 4529c757..7d86ceb4 100644 --- a/azalea-protocol/src/packets/config/c_update_enabled_features.rs +++ b/azalea-protocol/src/packets/config/c_update_enabled_features.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundUpdateEnabledFeatures { pub features: Vec<ResourceLocation>, } diff --git a/azalea-protocol/src/packets/config/c_update_tags.rs b/azalea-protocol/src/packets/config/c_update_tags.rs index 750e3499..5c306374 100644 --- a/azalea-protocol/src/packets/config/c_update_tags.rs +++ b/azalea-protocol/src/packets/config/c_update_tags.rs @@ -1,74 +1,9 @@ -use std::io::{self, Cursor}; -use std::ops::Deref; -use std::{collections::HashMap, io::Write}; - -use azalea_buf::{AzBuf, AzaleaReadVar, AzaleaWriteVar, BufReadError}; -use azalea_buf::{AzaleaRead, AzaleaWrite}; -use azalea_core::resource_location::ResourceLocation; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] +use crate::common::tags::TagMap; + +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundConfigPacket)] pub struct ClientboundUpdateTags { pub tags: TagMap, } - -#[derive(Clone, Debug)] -pub struct Tags { - pub name: ResourceLocation, - pub elements: Vec<i32>, -} - -#[derive(Clone, Debug)] -pub struct TagMap(pub HashMap<ResourceLocation, Vec<Tags>>); - -impl AzaleaRead for TagMap { - fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { - let length = u32::azalea_read_var(buf)? as usize; - let mut data = HashMap::with_capacity(length); - for _ in 0..length { - let tag_type = ResourceLocation::azalea_read(buf)?; - let tags_count = i32::azalea_read_var(buf)? as usize; - let mut tags_vec = Vec::with_capacity(tags_count); - for _ in 0..tags_count { - let tags = Tags::azalea_read(buf)?; - tags_vec.push(tags); - } - data.insert(tag_type, tags_vec); - } - Ok(TagMap(data)) - } -} - -impl AzaleaWrite for TagMap { - fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { - (self.len() as u32).azalea_write_var(buf)?; - for (k, v) in &self.0 { - k.azalea_write(buf)?; - v.azalea_write(buf)?; - } - Ok(()) - } -} -impl AzaleaRead for Tags { - fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { - let name = ResourceLocation::azalea_read(buf)?; - let elements = Vec::<i32>::azalea_read_var(buf)?; - Ok(Tags { name, elements }) - } -} - -impl AzaleaWrite for Tags { - fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { - self.name.azalea_write(buf)?; - self.elements.azalea_write_var(buf)?; - Ok(()) - } -} - -impl Deref for TagMap { - type Target = HashMap<ResourceLocation, Vec<Tags>>; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} diff --git a/azalea-protocol/src/packets/config/s_client_information.rs b/azalea-protocol/src/packets/config/s_client_information.rs index d58ce502..b6ab0f2a 100644 --- a/azalea-protocol/src/packets/config/s_client_information.rs +++ b/azalea-protocol/src/packets/config/s_client_information.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ServerboundConfigPacket; use crate::common::client_information::ClientInformation; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket, PartialEq, Eq)] +#[derive(Clone, Debug, AzBuf, PartialEq, Eq, ServerboundConfigPacket)] pub struct ServerboundClientInformation { pub information: ClientInformation, } diff --git a/azalea-protocol/src/packets/config/s_cookie_response.rs b/azalea-protocol/src/packets/config/s_cookie_response.rs index e932352f..590a651e 100644 --- a/azalea-protocol/src/packets/config/s_cookie_response.rs +++ b/azalea-protocol/src/packets/config/s_cookie_response.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundCookieResponse { pub key: ResourceLocation, pub payload: Option<Vec<u8>>, diff --git a/azalea-protocol/src/packets/config/s_custom_click_action.rs b/azalea-protocol/src/packets/config/s_custom_click_action.rs index eee03303..0c33d635 100644 --- a/azalea-protocol/src/packets/config/s_custom_click_action.rs +++ b/azalea-protocol/src/packets/config/s_custom_click_action.rs @@ -3,7 +3,7 @@ use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundConfigPacket; use simdnbt::owned::Nbt; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundCustomClickAction { pub id: ResourceLocation, pub payload: Nbt, diff --git a/azalea-protocol/src/packets/config/s_custom_payload.rs b/azalea-protocol/src/packets/config/s_custom_payload.rs index f480985d..fec04fb5 100644 --- a/azalea-protocol/src/packets/config/s_custom_payload.rs +++ b/azalea-protocol/src/packets/config/s_custom_payload.rs @@ -1,9 +1,8 @@ -use azalea_buf::AzBuf; -use azalea_buf::UnsizedByteArray; +use azalea_buf::{AzBuf, UnsizedByteArray}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundCustomPayload { pub identifier: ResourceLocation, pub data: UnsizedByteArray, diff --git a/azalea-protocol/src/packets/config/s_finish_configuration.rs b/azalea-protocol/src/packets/config/s_finish_configuration.rs index dc7d4316..618d7205 100644 --- a/azalea-protocol/src/packets/config/s_finish_configuration.rs +++ b/azalea-protocol/src/packets/config/s_finish_configuration.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundFinishConfiguration; diff --git a/azalea-protocol/src/packets/config/s_keep_alive.rs b/azalea-protocol/src/packets/config/s_keep_alive.rs index 1986a4eb..455d4109 100644 --- a/azalea-protocol/src/packets/config/s_keep_alive.rs +++ b/azalea-protocol/src/packets/config/s_keep_alive.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundKeepAlive { pub id: u64, } diff --git a/azalea-protocol/src/packets/config/s_pong.rs b/azalea-protocol/src/packets/config/s_pong.rs index 50c012dd..58abaff4 100644 --- a/azalea-protocol/src/packets/config/s_pong.rs +++ b/azalea-protocol/src/packets/config/s_pong.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundPong { pub id: u32, } diff --git a/azalea-protocol/src/packets/config/s_resource_pack.rs b/azalea-protocol/src/packets/config/s_resource_pack.rs index 0822c723..38a14af8 100644 --- a/azalea-protocol/src/packets/config/s_resource_pack.rs +++ b/azalea-protocol/src/packets/config/s_resource_pack.rs @@ -2,13 +2,13 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundResourcePack { pub id: Uuid, pub action: Action, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq)] pub enum Action { SuccessfullyLoaded = 0, Declined = 1, diff --git a/azalea-protocol/src/packets/config/s_select_known_packs.rs b/azalea-protocol/src/packets/config/s_select_known_packs.rs index 320b5ca5..ee139780 100644 --- a/azalea-protocol/src/packets/config/s_select_known_packs.rs +++ b/azalea-protocol/src/packets/config/s_select_known_packs.rs @@ -1,12 +1,12 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundConfigPacket)] pub struct ServerboundSelectKnownPacks { pub known_packs: Vec<KnownPack>, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct KnownPack { pub namespace: String, pub id: String, diff --git a/azalea-protocol/src/packets/game/c_add_entity.rs b/azalea-protocol/src/packets/game/c_add_entity.rs index b2370f3f..e71499c5 100644 --- a/azalea-protocol/src/packets/game/c_add_entity.rs +++ b/azalea-protocol/src/packets/game/c_add_entity.rs @@ -5,7 +5,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundAddEntity { /// The numeric ID of the entity being added to the world. #[var] diff --git a/azalea-protocol/src/packets/game/c_animate.rs b/azalea-protocol/src/packets/game/c_animate.rs index eaaa151d..b443513c 100644 --- a/azalea-protocol/src/packets/game/c_animate.rs +++ b/azalea-protocol/src/packets/game/c_animate.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundAnimate { #[var] pub id: MinecraftEntityId, @@ -11,7 +11,7 @@ pub struct ClientboundAnimate { // minecraft actually uses a u8 for this, but a varint still works and makes it // so i don't have to add a special handler -#[derive(Clone, Debug, Copy, AzBuf)] +#[derive(Clone, Debug, Copy, AzBuf, PartialEq)] pub enum AnimationAction { SwingMainHand = 0, Hurt = 1, diff --git a/azalea-protocol/src/packets/game/c_award_stats.rs b/azalea-protocol/src/packets/game/c_award_stats.rs index 20f8b1e0..bb58a066 100644 --- a/azalea-protocol/src/packets/game/c_award_stats.rs +++ b/azalea-protocol/src/packets/game/c_award_stats.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundAwardStats { #[var] pub stats: HashMap<Stat, i32>, diff --git a/azalea-protocol/src/packets/game/c_block_changed_ack.rs b/azalea-protocol/src/packets/game/c_block_changed_ack.rs index c477c1f2..10a33e3c 100644 --- a/azalea-protocol/src/packets/game/c_block_changed_ack.rs +++ b/azalea-protocol/src/packets/game/c_block_changed_ack.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundBlockChangedAck { #[var] pub seq: u32, diff --git a/azalea-protocol/src/packets/game/c_block_destruction.rs b/azalea-protocol/src/packets/game/c_block_destruction.rs index 4a6e5f69..86d238d6 100644 --- a/azalea-protocol/src/packets/game/c_block_destruction.rs +++ b/azalea-protocol/src/packets/game/c_block_destruction.rs @@ -3,7 +3,7 @@ use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundBlockDestruction { /// The ID of the entity breaking the block. #[var] diff --git a/azalea-protocol/src/packets/game/c_block_entity_data.rs b/azalea-protocol/src/packets/game/c_block_entity_data.rs index 82ba60de..e0c7bb1b 100644 --- a/azalea-protocol/src/packets/game/c_block_entity_data.rs +++ b/azalea-protocol/src/packets/game/c_block_entity_data.rs @@ -3,7 +3,7 @@ use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; use simdnbt::owned::Nbt; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundBlockEntityData { pub pos: BlockPos, pub block_entity_type: azalea_registry::BlockEntityKind, diff --git a/azalea-protocol/src/packets/game/c_block_event.rs b/azalea-protocol/src/packets/game/c_block_event.rs index 3a71b186..38b5099b 100644 --- a/azalea-protocol/src/packets/game/c_block_event.rs +++ b/azalea-protocol/src/packets/game/c_block_event.rs @@ -3,7 +3,7 @@ use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::Block; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundBlockEvent { pub pos: BlockPos, pub action_id: u8, diff --git a/azalea-protocol/src/packets/game/c_block_update.rs b/azalea-protocol/src/packets/game/c_block_update.rs index ae9bd998..dc193719 100644 --- a/azalea-protocol/src/packets/game/c_block_update.rs +++ b/azalea-protocol/src/packets/game/c_block_update.rs @@ -3,7 +3,7 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundBlockUpdate { pub pos: BlockPos, pub block_state: BlockState, diff --git a/azalea-protocol/src/packets/game/c_boss_event.rs b/azalea-protocol/src/packets/game/c_boss_event.rs index 18984985..de0629e0 100644 --- a/azalea-protocol/src/packets/game/c_boss_event.rs +++ b/azalea-protocol/src/packets/game/c_boss_event.rs @@ -1,6 +1,7 @@ -use std::io; -use std::io::Cursor; -use std::io::Write; +use std::{ + io, + io::{Cursor, Write}, +}; use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_chat::FormattedText; @@ -8,13 +9,13 @@ use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundBossEvent { pub id: Uuid, pub operation: Operation, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub enum Operation { Add(AddOperation), Remove, @@ -74,7 +75,7 @@ impl AzaleaWrite for Operation { } } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct AddOperation { pub name: FormattedText, pub progress: f32, @@ -82,13 +83,13 @@ pub struct AddOperation { pub properties: Properties, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct Style { pub color: BossBarColor, pub overlay: BossBarOverlay, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum BossBarColor { Pink = 0, Blue = 1, @@ -99,7 +100,7 @@ pub enum BossBarColor { White = 6, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum BossBarOverlay { Progress = 0, Notched6 = 1, @@ -108,7 +109,7 @@ pub enum BossBarOverlay { Notched20 = 4, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct Properties { pub darken_screen: bool, pub play_music: bool, diff --git a/azalea-protocol/src/packets/game/c_bundle_delimiter.rs b/azalea-protocol/src/packets/game/c_bundle_delimiter.rs index cda33d1b..ac98e82a 100644 --- a/azalea-protocol/src/packets/game/c_bundle_delimiter.rs +++ b/azalea-protocol/src/packets/game/c_bundle_delimiter.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundBundleDelimiter; diff --git a/azalea-protocol/src/packets/game/c_change_difficulty.rs b/azalea-protocol/src/packets/game/c_change_difficulty.rs index cdcc4792..89e2d09a 100644 --- a/azalea-protocol/src/packets/game/c_change_difficulty.rs +++ b/azalea-protocol/src/packets/game/c_change_difficulty.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::difficulty::Difficulty; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundChangeDifficulty { pub difficulty: Difficulty, pub locked: bool, diff --git a/azalea-protocol/src/packets/game/c_chunk_batch_finished.rs b/azalea-protocol/src/packets/game/c_chunk_batch_finished.rs index c419888b..6147867b 100644 --- a/azalea-protocol/src/packets/game/c_chunk_batch_finished.rs +++ b/azalea-protocol/src/packets/game/c_chunk_batch_finished.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundChunkBatchFinished { #[var] pub batch_size: u32, diff --git a/azalea-protocol/src/packets/game/c_chunk_batch_start.rs b/azalea-protocol/src/packets/game/c_chunk_batch_start.rs index b5cd1ba2..9321447b 100644 --- a/azalea-protocol/src/packets/game/c_chunk_batch_start.rs +++ b/azalea-protocol/src/packets/game/c_chunk_batch_start.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundChunkBatchStart; diff --git a/azalea-protocol/src/packets/game/c_chunks_biomes.rs b/azalea-protocol/src/packets/game/c_chunks_biomes.rs index a8e65af4..16007331 100644 --- a/azalea-protocol/src/packets/game/c_chunks_biomes.rs +++ b/azalea-protocol/src/packets/game/c_chunks_biomes.rs @@ -2,12 +2,12 @@ use azalea_buf::AzBuf; use azalea_core::position::ChunkPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundChunksBiomes { pub chunk_biome_data: Vec<ChunkBiomeData>, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct ChunkBiomeData { pub pos: ChunkPos, pub buffer: Vec<u8>, diff --git a/azalea-protocol/src/packets/game/c_clear_dialog.rs b/azalea-protocol/src/packets/game/c_clear_dialog.rs index 98aaf8cf..74a015a4 100644 --- a/azalea-protocol/src/packets/game/c_clear_dialog.rs +++ b/azalea-protocol/src/packets/game/c_clear_dialog.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundClearDialog; diff --git a/azalea-protocol/src/packets/game/c_clear_titles.rs b/azalea-protocol/src/packets/game/c_clear_titles.rs index 58b67bad..559f837f 100644 --- a/azalea-protocol/src/packets/game/c_clear_titles.rs +++ b/azalea-protocol/src/packets/game/c_clear_titles.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundClearTitles { pub reset_times: bool, } diff --git a/azalea-protocol/src/packets/game/c_command_suggestions.rs b/azalea-protocol/src/packets/game/c_command_suggestions.rs index 37679a72..4512b9b3 100644 --- a/azalea-protocol/src/packets/game/c_command_suggestions.rs +++ b/azalea-protocol/src/packets/game/c_command_suggestions.rs @@ -2,7 +2,7 @@ use azalea_brigadier::suggestion::Suggestions; use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCommandSuggestions { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_commands.rs b/azalea-protocol/src/packets/game/c_commands.rs index 7eeff658..303f8481 100644 --- a/azalea-protocol/src/packets/game/c_commands.rs +++ b/azalea-protocol/src/packets/game/c_commands.rs @@ -5,7 +5,7 @@ use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation}; use azalea_protocol_macros::ClientboundGamePacket; use tracing::warn; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCommands { pub entries: Vec<BrigadierNodeStub>, #[var] diff --git a/azalea-protocol/src/packets/game/c_container_close.rs b/azalea-protocol/src/packets/game/c_container_close.rs index 1e6623c0..32cb171f 100644 --- a/azalea-protocol/src/packets/game/c_container_close.rs +++ b/azalea-protocol/src/packets/game/c_container_close.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundContainerClose { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/c_container_set_content.rs b/azalea-protocol/src/packets/game/c_container_set_content.rs index 0619eff1..6048fd83 100644 --- a/azalea-protocol/src/packets/game/c_container_set_content.rs +++ b/azalea-protocol/src/packets/game/c_container_set_content.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundContainerSetContent { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/c_container_set_data.rs b/azalea-protocol/src/packets/game/c_container_set_data.rs index 149080b1..6c7907bb 100644 --- a/azalea-protocol/src/packets/game/c_container_set_data.rs +++ b/azalea-protocol/src/packets/game/c_container_set_data.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundContainerSetData { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/c_container_set_slot.rs b/azalea-protocol/src/packets/game/c_container_set_slot.rs index 20df5b06..73670439 100644 --- a/azalea-protocol/src/packets/game/c_container_set_slot.rs +++ b/azalea-protocol/src/packets/game/c_container_set_slot.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundContainerSetSlot { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/c_cookie_request.rs b/azalea-protocol/src/packets/game/c_cookie_request.rs index 330b7334..06828aec 100644 --- a/azalea-protocol/src/packets/game/c_cookie_request.rs +++ b/azalea-protocol/src/packets/game/c_cookie_request.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCookieRequest { pub key: ResourceLocation, } diff --git a/azalea-protocol/src/packets/game/c_cooldown.rs b/azalea-protocol/src/packets/game/c_cooldown.rs index 016101b7..c25bdad6 100644 --- a/azalea-protocol/src/packets/game/c_cooldown.rs +++ b/azalea-protocol/src/packets/game/c_cooldown.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCooldown { pub item: azalea_registry::Item, #[var] diff --git a/azalea-protocol/src/packets/game/c_custom_chat_completions.rs b/azalea-protocol/src/packets/game/c_custom_chat_completions.rs index 87c27b7a..8a96504d 100644 --- a/azalea-protocol/src/packets/game/c_custom_chat_completions.rs +++ b/azalea-protocol/src/packets/game/c_custom_chat_completions.rs @@ -1,13 +1,13 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCustomChatCompletions { pub action: Action, pub entries: Vec<String>, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum Action { Add = 0, Remove = 1, diff --git a/azalea-protocol/src/packets/game/c_custom_payload.rs b/azalea-protocol/src/packets/game/c_custom_payload.rs index 0610d63e..33c446c2 100644 --- a/azalea-protocol/src/packets/game/c_custom_payload.rs +++ b/azalea-protocol/src/packets/game/c_custom_payload.rs @@ -3,7 +3,7 @@ use azalea_buf::UnsizedByteArray; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCustomPayload { pub identifier: ResourceLocation, pub data: UnsizedByteArray, diff --git a/azalea-protocol/src/packets/game/c_custom_report_details.rs b/azalea-protocol/src/packets/game/c_custom_report_details.rs index 85eccfb7..cb7e6c9a 100644 --- a/azalea-protocol/src/packets/game/c_custom_report_details.rs +++ b/azalea-protocol/src/packets/game/c_custom_report_details.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundCustomReportDetails { // azalea doesn't implement max lengths yet diff --git a/azalea-protocol/src/packets/game/c_damage_event.rs b/azalea-protocol/src/packets/game/c_damage_event.rs index b7fd15c1..f6a1e401 100644 --- a/azalea-protocol/src/packets/game/c_damage_event.rs +++ b/azalea-protocol/src/packets/game/c_damage_event.rs @@ -5,7 +5,7 @@ use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundDamageEvent { #[var] pub entity_id: MinecraftEntityId, @@ -16,7 +16,7 @@ pub struct ClientboundDamageEvent { pub source_position: Option<Vec3>, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct OptionalEntityId(pub Option<u32>); impl AzaleaRead for OptionalEntityId { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, azalea_buf::BufReadError> { diff --git a/azalea-protocol/src/packets/game/c_debug_sample.rs b/azalea-protocol/src/packets/game/c_debug_sample.rs index 50550062..8c170419 100644 --- a/azalea-protocol/src/packets/game/c_debug_sample.rs +++ b/azalea-protocol/src/packets/game/c_debug_sample.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use super::s_debug_sample_subscription::RemoteDebugSampleType; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundDebugSample { pub sample: Vec<u64>, pub debug_sample_type: RemoteDebugSampleType, diff --git a/azalea-protocol/src/packets/game/c_delete_chat.rs b/azalea-protocol/src/packets/game/c_delete_chat.rs index d44a4553..fff8daa4 100644 --- a/azalea-protocol/src/packets/game/c_delete_chat.rs +++ b/azalea-protocol/src/packets/game/c_delete_chat.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use super::c_player_chat::PackedMessageSignature; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundDeleteChat { pub signature: PackedMessageSignature, } diff --git a/azalea-protocol/src/packets/game/c_disconnect.rs b/azalea-protocol/src/packets/game/c_disconnect.rs index ba197f1d..3cf21291 100644 --- a/azalea-protocol/src/packets/game/c_disconnect.rs +++ b/azalea-protocol/src/packets/game/c_disconnect.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundDisconnect { pub reason: FormattedText, } diff --git a/azalea-protocol/src/packets/game/c_disguised_chat.rs b/azalea-protocol/src/packets/game/c_disguised_chat.rs index 97157089..1242b3f7 100644 --- a/azalea-protocol/src/packets/game/c_disguised_chat.rs +++ b/azalea-protocol/src/packets/game/c_disguised_chat.rs @@ -11,7 +11,7 @@ use super::c_player_chat::ChatTypeBound; // [`ClientboundPlayerChat`], except that it doesn't have any of the chat // signing things. Vanilla servers use this when messages are sent from the // console. -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundDisguisedChat { pub message: FormattedText, pub chat_type: ChatTypeBound, diff --git a/azalea-protocol/src/packets/game/c_entity_event.rs b/azalea-protocol/src/packets/game/c_entity_event.rs index 6eb08adc..762841a2 100644 --- a/azalea-protocol/src/packets/game/c_entity_event.rs +++ b/azalea-protocol/src/packets/game/c_entity_event.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundEntityEvent { pub entity_id: MinecraftEntityId, pub event_id: u8, diff --git a/azalea-protocol/src/packets/game/c_entity_position_sync.rs b/azalea-protocol/src/packets/game/c_entity_position_sync.rs index e3ecc3f0..a48830ac 100644 --- a/azalea-protocol/src/packets/game/c_entity_position_sync.rs +++ b/azalea-protocol/src/packets/game/c_entity_position_sync.rs @@ -4,7 +4,7 @@ use azalea_world::MinecraftEntityId; use crate::common::movements::PositionMoveRotation; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundEntityPositionSync { #[var] pub id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_explode.rs b/azalea-protocol/src/packets/game/c_explode.rs index c5d90d03..e6ffa15c 100644 --- a/azalea-protocol/src/packets/game/c_explode.rs +++ b/azalea-protocol/src/packets/game/c_explode.rs @@ -4,7 +4,7 @@ use azalea_entity::particle::Particle; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::SoundEvent; -#[derive(Clone, Debug, ClientboundGamePacket, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundExplode { pub center: Vec3, pub knockback: Option<Vec3>, diff --git a/azalea-protocol/src/packets/game/c_forget_level_chunk.rs b/azalea-protocol/src/packets/game/c_forget_level_chunk.rs index bd901634..41a89f9a 100644 --- a/azalea-protocol/src/packets/game/c_forget_level_chunk.rs +++ b/azalea-protocol/src/packets/game/c_forget_level_chunk.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::position::ChunkPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundForgetLevelChunk { pub pos: ChunkPos, } diff --git a/azalea-protocol/src/packets/game/c_game_event.rs b/azalea-protocol/src/packets/game/c_game_event.rs index 940aa2f1..f04a18fe 100644 --- a/azalea-protocol/src/packets/game/c_game_event.rs +++ b/azalea-protocol/src/packets/game/c_game_event.rs @@ -1,13 +1,13 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundGameEvent { pub event: EventType, pub param: f32, } -#[derive(Clone, Debug, Copy, AzBuf)] +#[derive(Clone, Debug, Copy, AzBuf, PartialEq)] pub enum EventType { NoRespawnBlockAvailable = 0, StartRaining = 1, diff --git a/azalea-protocol/src/packets/game/c_horse_screen_open.rs b/azalea-protocol/src/packets/game/c_horse_screen_open.rs index 53730d24..4d139c8a 100644 --- a/azalea-protocol/src/packets/game/c_horse_screen_open.rs +++ b/azalea-protocol/src/packets/game/c_horse_screen_open.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundHorseScreenOpen { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/c_hurt_animation.rs b/azalea-protocol/src/packets/game/c_hurt_animation.rs index df019bd5..631eb402 100644 --- a/azalea-protocol/src/packets/game/c_hurt_animation.rs +++ b/azalea-protocol/src/packets/game/c_hurt_animation.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundHurtAnimation { #[var] pub id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_initialize_border.rs b/azalea-protocol/src/packets/game/c_initialize_border.rs index ca338b7f..48c5ed30 100644 --- a/azalea-protocol/src/packets/game/c_initialize_border.rs +++ b/azalea-protocol/src/packets/game/c_initialize_border.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, ClientboundGamePacket, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundInitializeBorder { pub new_center_x: f64, pub new_center_z: f64, diff --git a/azalea-protocol/src/packets/game/c_keep_alive.rs b/azalea-protocol/src/packets/game/c_keep_alive.rs index ff93560b..ba58c711 100644 --- a/azalea-protocol/src/packets/game/c_keep_alive.rs +++ b/azalea-protocol/src/packets/game/c_keep_alive.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundKeepAlive { pub id: u64, } diff --git a/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs b/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs index ad07f01e..af2228eb 100644 --- a/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs +++ b/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs @@ -7,7 +7,7 @@ use simdnbt::owned::Nbt; use super::c_light_update::ClientboundLightUpdatePacketData; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundLevelChunkWithLight { // this can't be a ChunkPos since that reads z first and then x pub x: i32, @@ -16,7 +16,7 @@ pub struct ClientboundLevelChunkWithLight { pub light_data: ClientboundLightUpdatePacketData, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct ClientboundLevelChunkPacketData { pub heightmaps: Vec<(HeightmapKind, Box<[u64]>)>, /// The raw chunk sections. @@ -30,7 +30,7 @@ pub struct ClientboundLevelChunkPacketData { pub block_entities: Vec<BlockEntity>, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct BlockEntity { pub packed_xz: u8, pub y: u16, diff --git a/azalea-protocol/src/packets/game/c_level_event.rs b/azalea-protocol/src/packets/game/c_level_event.rs index f41a1f42..08284559 100644 --- a/azalea-protocol/src/packets/game/c_level_event.rs +++ b/azalea-protocol/src/packets/game/c_level_event.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundLevelEvent { pub event_type: u32, pub pos: BlockPos, diff --git a/azalea-protocol/src/packets/game/c_level_particles.rs b/azalea-protocol/src/packets/game/c_level_particles.rs index 3f11bef2..b93e0de8 100644 --- a/azalea-protocol/src/packets/game/c_level_particles.rs +++ b/azalea-protocol/src/packets/game/c_level_particles.rs @@ -3,7 +3,7 @@ use azalea_core::position::Vec3; use azalea_entity::particle::Particle; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundLevelParticles { pub override_limiter: bool, pub always_show: bool, diff --git a/azalea-protocol/src/packets/game/c_light_update.rs b/azalea-protocol/src/packets/game/c_light_update.rs index 62b7a59d..46e78fe8 100644 --- a/azalea-protocol/src/packets/game/c_light_update.rs +++ b/azalea-protocol/src/packets/game/c_light_update.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::bitset::BitSet; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundLightUpdate { #[var] pub x: i32, @@ -11,7 +11,7 @@ pub struct ClientboundLightUpdate { pub light_data: ClientboundLightUpdatePacketData, } -#[derive(Clone, Debug, AzBuf, Default)] +#[derive(Clone, Debug, AzBuf, Default, PartialEq)] pub struct ClientboundLightUpdatePacketData { pub sky_y_mask: BitSet, pub block_y_mask: BitSet, diff --git a/azalea-protocol/src/packets/game/c_login.rs b/azalea-protocol/src/packets/game/c_login.rs index 63503697..61f553e3 100644 --- a/azalea-protocol/src/packets/game/c_login.rs +++ b/azalea-protocol/src/packets/game/c_login.rs @@ -9,7 +9,7 @@ use crate::packets::common::CommonPlayerSpawnInfo; /// /// This packet contains information about the state of the player, the /// world, and the registry. -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundLogin { pub player_id: MinecraftEntityId, pub hardcore: bool, diff --git a/azalea-protocol/src/packets/game/c_map_item_data.rs b/azalea-protocol/src/packets/game/c_map_item_data.rs index f8c036e3..4bd2b21d 100644 --- a/azalea-protocol/src/packets/game/c_map_item_data.rs +++ b/azalea-protocol/src/packets/game/c_map_item_data.rs @@ -4,7 +4,7 @@ use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, ClientboundGamePacket, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundMapItemData { #[var] pub map_id: u32, @@ -14,7 +14,7 @@ pub struct ClientboundMapItemData { pub color_patch: OptionalMapPatch, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct MapDecoration { pub decoration_type: DecorationType, pub x: i8, @@ -25,7 +25,7 @@ pub struct MapDecoration { pub name: Option<FormattedText>, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct OptionalMapPatch(pub Option<MapPatch>); impl AzaleaRead for OptionalMapPatch { @@ -49,7 +49,7 @@ impl AzaleaWrite for OptionalMapPatch { } } -#[derive(Debug, Clone, AzBuf)] +#[derive(Debug, Clone, AzBuf, PartialEq)] pub struct MapPatch { pub width: u8, pub height: u8, @@ -58,7 +58,7 @@ pub struct MapPatch { pub map_colors: Vec<u8>, } -#[derive(Clone, Copy, Debug, AzBuf)] +#[derive(Clone, Copy, Debug, AzBuf, PartialEq)] pub enum DecorationType { Player, Frame, diff --git a/azalea-protocol/src/packets/game/c_merchant_offers.rs b/azalea-protocol/src/packets/game/c_merchant_offers.rs index 8d4ba9b1..c8baff78 100644 --- a/azalea-protocol/src/packets/game/c_merchant_offers.rs +++ b/azalea-protocol/src/packets/game/c_merchant_offers.rs @@ -12,7 +12,7 @@ use azalea_inventory::{ use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::{DataComponentKind, Item}; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundMerchantOffers { #[var] pub container_id: i32, @@ -25,7 +25,7 @@ pub struct ClientboundMerchantOffers { pub can_restock: bool, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct MerchantOffer { pub base_cost_a: ItemCost, pub result: ItemStack, @@ -43,7 +43,7 @@ pub struct MerchantOffer { /// /// This can be converted into an [`ItemStackData`] with /// [`Self::into_item_stack`]. -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct ItemCost { pub item: Item, #[var] @@ -74,7 +74,7 @@ impl ItemCost { /// /// If you got this from [`ItemCost`], consider using /// [`ItemCost::into_item_stack`] for a better API instead. -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct DataComponentExactPredicate { pub expected: Vec<TypedDataComponent>, } @@ -129,3 +129,11 @@ impl Clone for TypedDataComponent { } } } +impl PartialEq for TypedDataComponent { + fn eq(&self, other: &Self) -> bool { + if self.kind != other.kind { + return false; + } + self.as_dyn().eq(other.as_dyn()) + } +} diff --git a/azalea-protocol/src/packets/game/c_move_entity_pos.rs b/azalea-protocol/src/packets/game/c_move_entity_pos.rs index 790a1580..b3fc81e8 100644 --- a/azalea-protocol/src/packets/game/c_move_entity_pos.rs +++ b/azalea-protocol/src/packets/game/c_move_entity_pos.rs @@ -3,7 +3,7 @@ use azalea_core::delta::PositionDelta8; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundMoveEntityPos { #[var] pub entity_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_move_entity_pos_rot.rs b/azalea-protocol/src/packets/game/c_move_entity_pos_rot.rs index 2d76aa14..3cdaaab5 100644 --- a/azalea-protocol/src/packets/game/c_move_entity_pos_rot.rs +++ b/azalea-protocol/src/packets/game/c_move_entity_pos_rot.rs @@ -4,7 +4,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; /// This packet is sent by the server when an entity moves less then 8 blocks. -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundMoveEntityPosRot { #[var] pub entity_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_move_entity_rot.rs b/azalea-protocol/src/packets/game/c_move_entity_rot.rs index e33a12e9..97f9c9c1 100644 --- a/azalea-protocol/src/packets/game/c_move_entity_rot.rs +++ b/azalea-protocol/src/packets/game/c_move_entity_rot.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundMoveEntityRot { #[var] pub entity_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_move_minecart_along_track.rs b/azalea-protocol/src/packets/game/c_move_minecart_along_track.rs index b6313b6a..31c785ec 100644 --- a/azalea-protocol/src/packets/game/c_move_minecart_along_track.rs +++ b/azalea-protocol/src/packets/game/c_move_minecart_along_track.rs @@ -3,14 +3,14 @@ use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundMoveMinecartAlongTrack { #[var] pub entity_id: MinecraftEntityId, pub lerp_steps: Vec<MinecartStep>, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct MinecartStep { pub position: Vec3, pub movement: Vec3, diff --git a/azalea-protocol/src/packets/game/c_move_vehicle.rs b/azalea-protocol/src/packets/game/c_move_vehicle.rs index e9891694..6975f023 100644 --- a/azalea-protocol/src/packets/game/c_move_vehicle.rs +++ b/azalea-protocol/src/packets/game/c_move_vehicle.rs @@ -3,7 +3,7 @@ use azalea_core::position::Vec3; use azalea_entity::LookDirection; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundMoveVehicle { pub pos: Vec3, pub look_direction: LookDirection, diff --git a/azalea-protocol/src/packets/game/c_open_book.rs b/azalea-protocol/src/packets/game/c_open_book.rs index 2c4f6b15..952ab412 100644 --- a/azalea-protocol/src/packets/game/c_open_book.rs +++ b/azalea-protocol/src/packets/game/c_open_book.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use super::s_interact::InteractionHand; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundOpenBook { pub hand: InteractionHand, } diff --git a/azalea-protocol/src/packets/game/c_open_screen.rs b/azalea-protocol/src/packets/game/c_open_screen.rs index 834802dd..b4a38387 100644 --- a/azalea-protocol/src/packets/game/c_open_screen.rs +++ b/azalea-protocol/src/packets/game/c_open_screen.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundOpenScreen { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/c_open_sign_editor.rs b/azalea-protocol/src/packets/game/c_open_sign_editor.rs index 52f5922c..66ebaece 100644 --- a/azalea-protocol/src/packets/game/c_open_sign_editor.rs +++ b/azalea-protocol/src/packets/game/c_open_sign_editor.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundOpenSignEditor { pub pos: BlockPos, pub is_front_text: bool, diff --git a/azalea-protocol/src/packets/game/c_ping.rs b/azalea-protocol/src/packets/game/c_ping.rs index 956aca8d..e6e3e143 100644 --- a/azalea-protocol/src/packets/game/c_ping.rs +++ b/azalea-protocol/src/packets/game/c_ping.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPing { pub id: u32, } diff --git a/azalea-protocol/src/packets/game/c_place_ghost_recipe.rs b/azalea-protocol/src/packets/game/c_place_ghost_recipe.rs index ec2fc772..a0c93962 100644 --- a/azalea-protocol/src/packets/game/c_place_ghost_recipe.rs +++ b/azalea-protocol/src/packets/game/c_place_ghost_recipe.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use crate::common::recipe::RecipeDisplayData; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlaceGhostRecipe { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/c_player_abilities.rs b/azalea-protocol/src/packets/game/c_player_abilities.rs index 8f7bbf20..82b43b3d 100644 --- a/azalea-protocol/src/packets/game/c_player_abilities.rs +++ b/azalea-protocol/src/packets/game/c_player_abilities.rs @@ -5,7 +5,7 @@ use azalea_core::bitset::FixedBitSet; use azalea_entity::PlayerAbilities; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerAbilities { pub flags: PlayerAbilitiesFlags, pub flying_speed: f32, @@ -13,7 +13,7 @@ pub struct ClientboundPlayerAbilities { pub walking_speed: f32, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct PlayerAbilitiesFlags { pub invulnerable: bool, pub flying: bool, diff --git a/azalea-protocol/src/packets/game/c_player_chat.rs b/azalea-protocol/src/packets/game/c_player_chat.rs index d44e5f59..d8056d12 100644 --- a/azalea-protocol/src/packets/game/c_player_chat.rs +++ b/azalea-protocol/src/packets/game/c_player_chat.rs @@ -12,7 +12,7 @@ use azalea_registry::Holder; use simdnbt::owned::NbtCompound; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerChat { #[var] pub global_index: u32, diff --git a/azalea-protocol/src/packets/game/c_player_combat_end.rs b/azalea-protocol/src/packets/game/c_player_combat_end.rs index b8029f1b..d1cc5cde 100644 --- a/azalea-protocol/src/packets/game/c_player_combat_end.rs +++ b/azalea-protocol/src/packets/game/c_player_combat_end.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; /// Unused by the client in vanilla. -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerCombatEnd { #[var] pub duration: u32, diff --git a/azalea-protocol/src/packets/game/c_player_combat_enter.rs b/azalea-protocol/src/packets/game/c_player_combat_enter.rs index ee58e277..82c44f9e 100644 --- a/azalea-protocol/src/packets/game/c_player_combat_enter.rs +++ b/azalea-protocol/src/packets/game/c_player_combat_enter.rs @@ -2,5 +2,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; /// Unused in vanilla. -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerCombatEnter; diff --git a/azalea-protocol/src/packets/game/c_player_combat_kill.rs b/azalea-protocol/src/packets/game/c_player_combat_kill.rs index 2d6fc3e7..ae758b44 100644 --- a/azalea-protocol/src/packets/game/c_player_combat_kill.rs +++ b/azalea-protocol/src/packets/game/c_player_combat_kill.rs @@ -4,7 +4,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; /// Used to send a respawn screen. -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerCombatKill { #[var] pub player_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_player_info_remove.rs b/azalea-protocol/src/packets/game/c_player_info_remove.rs index fcaef9d4..5b11048f 100644 --- a/azalea-protocol/src/packets/game/c_player_info_remove.rs +++ b/azalea-protocol/src/packets/game/c_player_info_remove.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerInfoRemove { pub profile_ids: Vec<Uuid>, } diff --git a/azalea-protocol/src/packets/game/c_player_info_update.rs b/azalea-protocol/src/packets/game/c_player_info_update.rs index 0041b483..6f0ae3f7 100644 --- a/azalea-protocol/src/packets/game/c_player_info_update.rs +++ b/azalea-protocol/src/packets/game/c_player_info_update.rs @@ -12,13 +12,13 @@ use uuid::Uuid; use super::s_chat_session_update::RemoteChatSessionData; -#[derive(Clone, Debug, ClientboundGamePacket)] +#[derive(Clone, Debug, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerInfoUpdate { pub actions: ActionEnumSet, pub entries: Vec<PlayerInfoEntry>, } -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug, Default, PartialEq)] pub struct PlayerInfoEntry { pub profile: GameProfile, pub listed: bool, diff --git a/azalea-protocol/src/packets/game/c_player_look_at.rs b/azalea-protocol/src/packets/game/c_player_look_at.rs index cc5e0bda..06b84adf 100644 --- a/azalea-protocol/src/packets/game/c_player_look_at.rs +++ b/azalea-protocol/src/packets/game/c_player_look_at.rs @@ -2,20 +2,20 @@ use azalea_buf::AzBuf; use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerLookAt { pub from_anchor: Anchor, pub pos: Vec3, pub entity: Option<AtEntity>, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum Anchor { Feet = 0, Eyes = 1, } -#[derive(AzBuf, Clone, Debug)] +#[derive(AzBuf, Clone, Debug, PartialEq)] pub struct AtEntity { #[var] pub entity: u32, diff --git a/azalea-protocol/src/packets/game/c_player_position.rs b/azalea-protocol/src/packets/game/c_player_position.rs index 7b95fef7..2ec56d4b 100644 --- a/azalea-protocol/src/packets/game/c_player_position.rs +++ b/azalea-protocol/src/packets/game/c_player_position.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use crate::common::movements::{PositionMoveRotation, RelativeMovements}; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerPosition { /// The teleport ID. #[var] diff --git a/azalea-protocol/src/packets/game/c_player_rotation.rs b/azalea-protocol/src/packets/game/c_player_rotation.rs index 3e214203..c3d72720 100644 --- a/azalea-protocol/src/packets/game/c_player_rotation.rs +++ b/azalea-protocol/src/packets/game/c_player_rotation.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_entity::LookDirection; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPlayerRotation { pub look_direction: LookDirection, } diff --git a/azalea-protocol/src/packets/game/c_pong_response.rs b/azalea-protocol/src/packets/game/c_pong_response.rs index 835666db..51aa40c3 100644 --- a/azalea-protocol/src/packets/game/c_pong_response.rs +++ b/azalea-protocol/src/packets/game/c_pong_response.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundPongResponse { pub time: u64, } diff --git a/azalea-protocol/src/packets/game/c_projectile_power.rs b/azalea-protocol/src/packets/game/c_projectile_power.rs index d7d445a2..643c6172 100644 --- a/azalea-protocol/src/packets/game/c_projectile_power.rs +++ b/azalea-protocol/src/packets/game/c_projectile_power.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundProjectilePower { #[var] pub id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_recipe_book_add.rs b/azalea-protocol/src/packets/game/c_recipe_book_add.rs index d31c4e74..699843fa 100644 --- a/azalea-protocol/src/packets/game/c_recipe_book_add.rs +++ b/azalea-protocol/src/packets/game/c_recipe_book_add.rs @@ -3,19 +3,19 @@ use azalea_protocol_macros::ClientboundGamePacket; use crate::common::recipe::{Ingredient, RecipeDisplayData}; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundRecipeBookAdd { pub entries: Vec<Entry>, pub replace: bool, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct Entry { pub contents: RecipeDisplayEntry, pub flags: u8, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct RecipeDisplayEntry { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_recipe_book_remove.rs b/azalea-protocol/src/packets/game/c_recipe_book_remove.rs index 983c5e12..222730f4 100644 --- a/azalea-protocol/src/packets/game/c_recipe_book_remove.rs +++ b/azalea-protocol/src/packets/game/c_recipe_book_remove.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundRecipeBookRemove { #[var] pub recipes: Vec<u32>, diff --git a/azalea-protocol/src/packets/game/c_recipe_book_settings.rs b/azalea-protocol/src/packets/game/c_recipe_book_settings.rs index f88a9733..9bffcce6 100644 --- a/azalea-protocol/src/packets/game/c_recipe_book_settings.rs +++ b/azalea-protocol/src/packets/game/c_recipe_book_settings.rs @@ -1,12 +1,12 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundRecipeBookSettings { pub book_settings: RecipeBookSettings, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct RecipeBookSettings { pub gui_open: bool, pub filtering_craftable: bool, diff --git a/azalea-protocol/src/packets/game/c_remove_entities.rs b/azalea-protocol/src/packets/game/c_remove_entities.rs index 5424cb3c..8711abb7 100644 --- a/azalea-protocol/src/packets/game/c_remove_entities.rs +++ b/azalea-protocol/src/packets/game/c_remove_entities.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundRemoveEntities { #[var] pub entity_ids: Vec<MinecraftEntityId>, diff --git a/azalea-protocol/src/packets/game/c_remove_mob_effect.rs b/azalea-protocol/src/packets/game/c_remove_mob_effect.rs index 08d9416e..950c07ec 100644 --- a/azalea-protocol/src/packets/game/c_remove_mob_effect.rs +++ b/azalea-protocol/src/packets/game/c_remove_mob_effect.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundRemoveMobEffect { #[var] pub entity_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_reset_score.rs b/azalea-protocol/src/packets/game/c_reset_score.rs index 8a40dd0d..d974b290 100644 --- a/azalea-protocol/src/packets/game/c_reset_score.rs +++ b/azalea-protocol/src/packets/game/c_reset_score.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundResetScore { pub owner: String, pub objective_name: Option<String>, diff --git a/azalea-protocol/src/packets/game/c_resource_pack_pop.rs b/azalea-protocol/src/packets/game/c_resource_pack_pop.rs index 14150ea1..2b41f0da 100644 --- a/azalea-protocol/src/packets/game/c_resource_pack_pop.rs +++ b/azalea-protocol/src/packets/game/c_resource_pack_pop.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundResourcePackPop { pub id: Option<Uuid>, } diff --git a/azalea-protocol/src/packets/game/c_resource_pack_push.rs b/azalea-protocol/src/packets/game/c_resource_pack_push.rs index 6e355029..767670fd 100644 --- a/azalea-protocol/src/packets/game/c_resource_pack_push.rs +++ b/azalea-protocol/src/packets/game/c_resource_pack_push.rs @@ -3,7 +3,7 @@ use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundResourcePackPush { pub id: Uuid, pub url: String, diff --git a/azalea-protocol/src/packets/game/c_respawn.rs b/azalea-protocol/src/packets/game/c_respawn.rs index 79bbfd1d..5dad5f6f 100644 --- a/azalea-protocol/src/packets/game/c_respawn.rs +++ b/azalea-protocol/src/packets/game/c_respawn.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use crate::packets::common::CommonPlayerSpawnInfo; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundRespawn { pub common: CommonPlayerSpawnInfo, pub data_to_keep: u8, diff --git a/azalea-protocol/src/packets/game/c_rotate_head.rs b/azalea-protocol/src/packets/game/c_rotate_head.rs index d4dec203..6c961609 100644 --- a/azalea-protocol/src/packets/game/c_rotate_head.rs +++ b/azalea-protocol/src/packets/game/c_rotate_head.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundRotateHead { #[var] pub entity_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_section_blocks_update.rs b/azalea-protocol/src/packets/game/c_section_blocks_update.rs index b9d07db3..8bfe45b7 100644 --- a/azalea-protocol/src/packets/game/c_section_blocks_update.rs +++ b/azalea-protocol/src/packets/game/c_section_blocks_update.rs @@ -5,13 +5,13 @@ use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, use azalea_core::position::{ChunkSectionBlockPos, ChunkSectionPos}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSectionBlocksUpdate { pub section_pos: ChunkSectionPos, pub states: Vec<BlockStateWithPosition>, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct BlockStateWithPosition { pub pos: ChunkSectionBlockPos, pub state: BlockState, diff --git a/azalea-protocol/src/packets/game/c_select_advancements_tab.rs b/azalea-protocol/src/packets/game/c_select_advancements_tab.rs index eb4cc62a..ec390ce5 100644 --- a/azalea-protocol/src/packets/game/c_select_advancements_tab.rs +++ b/azalea-protocol/src/packets/game/c_select_advancements_tab.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSelectAdvancementsTab { pub tab: Option<ResourceLocation>, } diff --git a/azalea-protocol/src/packets/game/c_server_data.rs b/azalea-protocol/src/packets/game/c_server_data.rs index 22116685..43aaf8f7 100644 --- a/azalea-protocol/src/packets/game/c_server_data.rs +++ b/azalea-protocol/src/packets/game/c_server_data.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundServerData { pub motd: FormattedText, pub icon_bytes: Option<Vec<u8>>, diff --git a/azalea-protocol/src/packets/game/c_server_links.rs b/azalea-protocol/src/packets/game/c_server_links.rs index e566b64e..ffb62517 100644 --- a/azalea-protocol/src/packets/game/c_server_links.rs +++ b/azalea-protocol/src/packets/game/c_server_links.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use crate::common::server_links::ServerLinkEntry; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundServerLinks { pub links: Vec<ServerLinkEntry>, } diff --git a/azalea-protocol/src/packets/game/c_set_action_bar_text.rs b/azalea-protocol/src/packets/game/c_set_action_bar_text.rs index d08c5021..2ea07089 100644 --- a/azalea-protocol/src/packets/game/c_set_action_bar_text.rs +++ b/azalea-protocol/src/packets/game/c_set_action_bar_text.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetActionBarText { pub text: FormattedText, } diff --git a/azalea-protocol/src/packets/game/c_set_border_center.rs b/azalea-protocol/src/packets/game/c_set_border_center.rs index afc49556..7d4ae1d8 100644 --- a/azalea-protocol/src/packets/game/c_set_border_center.rs +++ b/azalea-protocol/src/packets/game/c_set_border_center.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetBorderCenter { pub new_center_x: f64, pub new_center_z: f64, diff --git a/azalea-protocol/src/packets/game/c_set_border_lerp_size.rs b/azalea-protocol/src/packets/game/c_set_border_lerp_size.rs index 3c70a40e..219d478f 100644 --- a/azalea-protocol/src/packets/game/c_set_border_lerp_size.rs +++ b/azalea-protocol/src/packets/game/c_set_border_lerp_size.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetBorderLerpSize { pub old_size: f64, pub new_size: f64, diff --git a/azalea-protocol/src/packets/game/c_set_border_size.rs b/azalea-protocol/src/packets/game/c_set_border_size.rs index 6884cde6..cb6b58c6 100644 --- a/azalea-protocol/src/packets/game/c_set_border_size.rs +++ b/azalea-protocol/src/packets/game/c_set_border_size.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetBorderSize { pub size: f64, } diff --git a/azalea-protocol/src/packets/game/c_set_border_warning_delay.rs b/azalea-protocol/src/packets/game/c_set_border_warning_delay.rs index e1126165..4f1bbead 100644 --- a/azalea-protocol/src/packets/game/c_set_border_warning_delay.rs +++ b/azalea-protocol/src/packets/game/c_set_border_warning_delay.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetBorderWarningDelay { #[var] pub warning_delay: u32, diff --git a/azalea-protocol/src/packets/game/c_set_border_warning_distance.rs b/azalea-protocol/src/packets/game/c_set_border_warning_distance.rs index dbb2a742..4b3cdbea 100644 --- a/azalea-protocol/src/packets/game/c_set_border_warning_distance.rs +++ b/azalea-protocol/src/packets/game/c_set_border_warning_distance.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetBorderWarningDistance { #[var] pub warning_blocks: u32, diff --git a/azalea-protocol/src/packets/game/c_set_camera.rs b/azalea-protocol/src/packets/game/c_set_camera.rs index 277b80a3..97e0aedc 100644 --- a/azalea-protocol/src/packets/game/c_set_camera.rs +++ b/azalea-protocol/src/packets/game/c_set_camera.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetCamera { #[var] pub camera_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_set_chunk_cache_center.rs b/azalea-protocol/src/packets/game/c_set_chunk_cache_center.rs index 4c66213c..24507c4c 100644 --- a/azalea-protocol/src/packets/game/c_set_chunk_cache_center.rs +++ b/azalea-protocol/src/packets/game/c_set_chunk_cache_center.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetChunkCacheCenter { #[var] pub x: i32, diff --git a/azalea-protocol/src/packets/game/c_set_chunk_cache_radius.rs b/azalea-protocol/src/packets/game/c_set_chunk_cache_radius.rs index b992e572..e17ea3a2 100644 --- a/azalea-protocol/src/packets/game/c_set_chunk_cache_radius.rs +++ b/azalea-protocol/src/packets/game/c_set_chunk_cache_radius.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetChunkCacheRadius { #[var] pub radius: u32, diff --git a/azalea-protocol/src/packets/game/c_set_cursor_item.rs b/azalea-protocol/src/packets/game/c_set_cursor_item.rs index 7736ae2d..7e207d18 100644 --- a/azalea-protocol/src/packets/game/c_set_cursor_item.rs +++ b/azalea-protocol/src/packets/game/c_set_cursor_item.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetCursorItem { pub contents: ItemStack, } diff --git a/azalea-protocol/src/packets/game/c_set_default_spawn_position.rs b/azalea-protocol/src/packets/game/c_set_default_spawn_position.rs index b6262ac8..fd487b10 100644 --- a/azalea-protocol/src/packets/game/c_set_default_spawn_position.rs +++ b/azalea-protocol/src/packets/game/c_set_default_spawn_position.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetDefaultSpawnPosition { pub pos: BlockPos, pub angle: f32, diff --git a/azalea-protocol/src/packets/game/c_set_display_objective.rs b/azalea-protocol/src/packets/game/c_set_display_objective.rs index 12118772..3abc847f 100644 --- a/azalea-protocol/src/packets/game/c_set_display_objective.rs +++ b/azalea-protocol/src/packets/game/c_set_display_objective.rs @@ -1,13 +1,13 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetDisplayObjective { pub slot: DisplaySlot, pub objective_name: String, } -#[derive(Clone, Debug, Copy, AzBuf)] +#[derive(Clone, Debug, Copy, AzBuf, PartialEq)] pub enum DisplaySlot { List = 0, Sidebar, 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 fea83941..666f6643 100644 --- a/azalea-protocol/src/packets/game/c_set_entity_data.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_data.rs @@ -3,7 +3,7 @@ use azalea_entity::EntityMetadataItems; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetEntityData { #[var] pub id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_set_entity_link.rs b/azalea-protocol/src/packets/game/c_set_entity_link.rs index 2a38db76..efa1262a 100644 --- a/azalea-protocol/src/packets/game/c_set_entity_link.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_link.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetEntityLink { pub source_id: MinecraftEntityId, pub dest_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_set_entity_motion.rs b/azalea-protocol/src/packets/game/c_set_entity_motion.rs index 06b457f7..ecbe17a6 100644 --- a/azalea-protocol/src/packets/game/c_set_entity_motion.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_motion.rs @@ -3,7 +3,7 @@ use azalea_core::delta::PositionDelta8; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetEntityMotion { #[var] pub id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_set_equipment.rs b/azalea-protocol/src/packets/game/c_set_equipment.rs index c80e0072..b52672b0 100644 --- a/azalea-protocol/src/packets/game/c_set_equipment.rs +++ b/azalea-protocol/src/packets/game/c_set_equipment.rs @@ -1,19 +1,18 @@ use std::io::{self, Cursor, Write}; -use azalea_buf::{AzBuf, BufReadError}; -use azalea_buf::{AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetEquipment { #[var] pub entity_id: MinecraftEntityId, pub slots: EquipmentSlots, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct EquipmentSlots { pub slots: Vec<(EquipmentSlot, ItemStack)>, } @@ -56,7 +55,7 @@ impl AzaleaWrite for EquipmentSlots { } } -#[derive(Clone, Debug, Copy, AzBuf)] +#[derive(Clone, Debug, Copy, AzBuf, PartialEq)] pub enum EquipmentSlot { MainHand = 0, OffHand = 1, diff --git a/azalea-protocol/src/packets/game/c_set_experience.rs b/azalea-protocol/src/packets/game/c_set_experience.rs index c11482a0..8b18ee81 100644 --- a/azalea-protocol/src/packets/game/c_set_experience.rs +++ b/azalea-protocol/src/packets/game/c_set_experience.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetExperience { pub experience_progress: f32, #[var] diff --git a/azalea-protocol/src/packets/game/c_set_health.rs b/azalea-protocol/src/packets/game/c_set_health.rs index 56f3fe03..b80b0361 100644 --- a/azalea-protocol/src/packets/game/c_set_health.rs +++ b/azalea-protocol/src/packets/game/c_set_health.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetHealth { pub health: f32, #[var] diff --git a/azalea-protocol/src/packets/game/c_set_held_slot.rs b/azalea-protocol/src/packets/game/c_set_held_slot.rs index 5f188cc6..6b51be26 100644 --- a/azalea-protocol/src/packets/game/c_set_held_slot.rs +++ b/azalea-protocol/src/packets/game/c_set_held_slot.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetHeldSlot { #[var] pub slot: u32, diff --git a/azalea-protocol/src/packets/game/c_set_objective.rs b/azalea-protocol/src/packets/game/c_set_objective.rs index 0f5ffdc1..853bc28a 100644 --- a/azalea-protocol/src/packets/game/c_set_objective.rs +++ b/azalea-protocol/src/packets/game/c_set_objective.rs @@ -5,20 +5,20 @@ use azalea_chat::{FormattedText, numbers::NumberFormat}; use azalea_core::objectives::ObjectiveCriteria; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetObjective { pub objective_name: String, pub method: Method, } -#[derive(Clone, Copy, Debug, AzBuf)] +#[derive(Clone, Copy, Debug, AzBuf, PartialEq)] pub enum MethodKind { Add, Remove, Change, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub enum Method { Add { display_name: FormattedText, diff --git a/azalea-protocol/src/packets/game/c_set_passengers.rs b/azalea-protocol/src/packets/game/c_set_passengers.rs index 76fc3ca0..a6806024 100644 --- a/azalea-protocol/src/packets/game/c_set_passengers.rs +++ b/azalea-protocol/src/packets/game/c_set_passengers.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetPassengers { #[var] pub vehicle: u32, diff --git a/azalea-protocol/src/packets/game/c_set_player_inventory.rs b/azalea-protocol/src/packets/game/c_set_player_inventory.rs index 6775a486..0f3b3b73 100644 --- a/azalea-protocol/src/packets/game/c_set_player_inventory.rs +++ b/azalea-protocol/src/packets/game/c_set_player_inventory.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetPlayerInventory { #[var] pub slot: u32, diff --git a/azalea-protocol/src/packets/game/c_set_player_team.rs b/azalea-protocol/src/packets/game/c_set_player_team.rs index 8c195154..3f644eb7 100644 --- a/azalea-protocol/src/packets/game/c_set_player_team.rs +++ b/azalea-protocol/src/packets/game/c_set_player_team.rs @@ -2,13 +2,13 @@ use azalea_buf::AzBuf; use azalea_chat::{FormattedText, style::ChatFormatting}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetPlayerTeam { pub name: String, pub method: Method, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub enum Method { Add((Parameters, PlayerList)), Remove, @@ -17,7 +17,7 @@ pub enum Method { Leave(PlayerList), } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct Parameters { pub display_name: FormattedText, pub options: u8, @@ -28,7 +28,7 @@ pub struct Parameters { pub player_suffix: FormattedText, } -#[derive(Clone, Copy, Debug, AzBuf)] +#[derive(Clone, Copy, Debug, AzBuf, PartialEq)] pub enum CollisionRule { Always, Never, @@ -36,7 +36,7 @@ pub enum CollisionRule { PushOwnTeam, } -#[derive(Clone, Copy, Debug, AzBuf)] +#[derive(Clone, Copy, Debug, AzBuf, PartialEq)] pub enum NameTagVisibility { Always, Never, diff --git a/azalea-protocol/src/packets/game/c_set_score.rs b/azalea-protocol/src/packets/game/c_set_score.rs index 5a16d134..0dd68905 100644 --- a/azalea-protocol/src/packets/game/c_set_score.rs +++ b/azalea-protocol/src/packets/game/c_set_score.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::{numbers::NumberFormat, FormattedText}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetScore { pub owner: String, pub objective_name: String, diff --git a/azalea-protocol/src/packets/game/c_set_simulation_distance.rs b/azalea-protocol/src/packets/game/c_set_simulation_distance.rs index 2a80d1f1..6ec6df07 100644 --- a/azalea-protocol/src/packets/game/c_set_simulation_distance.rs +++ b/azalea-protocol/src/packets/game/c_set_simulation_distance.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetSimulationDistance { #[var] pub simulation_distance: u32, diff --git a/azalea-protocol/src/packets/game/c_set_subtitle_text.rs b/azalea-protocol/src/packets/game/c_set_subtitle_text.rs index 31405739..c011eb4d 100644 --- a/azalea-protocol/src/packets/game/c_set_subtitle_text.rs +++ b/azalea-protocol/src/packets/game/c_set_subtitle_text.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetSubtitleText { pub text: FormattedText, } diff --git a/azalea-protocol/src/packets/game/c_set_time.rs b/azalea-protocol/src/packets/game/c_set_time.rs index b1970eec..75bdbde6 100644 --- a/azalea-protocol/src/packets/game/c_set_time.rs +++ b/azalea-protocol/src/packets/game/c_set_time.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetTime { pub game_time: u64, pub day_time: u64, diff --git a/azalea-protocol/src/packets/game/c_set_title_text.rs b/azalea-protocol/src/packets/game/c_set_title_text.rs index 4ef3e590..b75f5ffd 100644 --- a/azalea-protocol/src/packets/game/c_set_title_text.rs +++ b/azalea-protocol/src/packets/game/c_set_title_text.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetTitleText { pub text: FormattedText, } diff --git a/azalea-protocol/src/packets/game/c_set_titles_animation.rs b/azalea-protocol/src/packets/game/c_set_titles_animation.rs index cc0c37fc..a7d5897b 100644 --- a/azalea-protocol/src/packets/game/c_set_titles_animation.rs +++ b/azalea-protocol/src/packets/game/c_set_titles_animation.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSetTitlesAnimation { pub fade_in: u32, pub stay: u32, diff --git a/azalea-protocol/src/packets/game/c_show_dialog.rs b/azalea-protocol/src/packets/game/c_show_dialog.rs index d059f843..1bcce17f 100644 --- a/azalea-protocol/src/packets/game/c_show_dialog.rs +++ b/azalea-protocol/src/packets/game/c_show_dialog.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::Holder; use simdnbt::owned::Nbt; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundShowDialog { pub dialog: Holder<azalea_registry::Dialog, Nbt>, } diff --git a/azalea-protocol/src/packets/game/c_sound.rs b/azalea-protocol/src/packets/game/c_sound.rs index bb037e97..a125546a 100644 --- a/azalea-protocol/src/packets/game/c_sound.rs +++ b/azalea-protocol/src/packets/game/c_sound.rs @@ -3,7 +3,7 @@ use azalea_core::sound::CustomSound; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::SoundEvent; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSound { pub sound: azalea_registry::Holder<SoundEvent, CustomSound>, pub source: SoundSource, @@ -16,7 +16,7 @@ pub struct ClientboundSound { pub seed: u64, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum SoundSource { Master = 0, Music = 1, diff --git a/azalea-protocol/src/packets/game/c_sound_entity.rs b/azalea-protocol/src/packets/game/c_sound_entity.rs index a6d17b72..e728e6eb 100644 --- a/azalea-protocol/src/packets/game/c_sound_entity.rs +++ b/azalea-protocol/src/packets/game/c_sound_entity.rs @@ -6,7 +6,7 @@ use azalea_world::MinecraftEntityId; use super::c_sound::SoundSource; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSoundEntity { pub sound: azalea_registry::Holder<SoundEvent, CustomSound>, pub source: SoundSource, diff --git a/azalea-protocol/src/packets/game/c_start_configuration.rs b/azalea-protocol/src/packets/game/c_start_configuration.rs index d1c60d5e..d419ab52 100644 --- a/azalea-protocol/src/packets/game/c_start_configuration.rs +++ b/azalea-protocol/src/packets/game/c_start_configuration.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundStartConfiguration; diff --git a/azalea-protocol/src/packets/game/c_stop_sound.rs b/azalea-protocol/src/packets/game/c_stop_sound.rs index da689882..70f3c424 100644 --- a/azalea-protocol/src/packets/game/c_stop_sound.rs +++ b/azalea-protocol/src/packets/game/c_stop_sound.rs @@ -6,7 +6,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use super::c_sound::SoundSource; -#[derive(Clone, Debug, ClientboundGamePacket)] +#[derive(Clone, Debug, PartialEq, ClientboundGamePacket)] pub struct ClientboundStopSound { pub source: Option<SoundSource>, pub name: Option<ResourceLocation>, diff --git a/azalea-protocol/src/packets/game/c_store_cookie.rs b/azalea-protocol/src/packets/game/c_store_cookie.rs index a1deee4f..0b48ed0e 100644 --- a/azalea-protocol/src/packets/game/c_store_cookie.rs +++ b/azalea-protocol/src/packets/game/c_store_cookie.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundStoreCookie { pub key: ResourceLocation, pub payload: Vec<u8>, diff --git a/azalea-protocol/src/packets/game/c_system_chat.rs b/azalea-protocol/src/packets/game/c_system_chat.rs index b47fc5bd..c57c0df0 100644 --- a/azalea-protocol/src/packets/game/c_system_chat.rs +++ b/azalea-protocol/src/packets/game/c_system_chat.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundSystemChat { pub content: FormattedText, pub overlay: bool, diff --git a/azalea-protocol/src/packets/game/c_tab_list.rs b/azalea-protocol/src/packets/game/c_tab_list.rs index 268351da..0105b981 100644 --- a/azalea-protocol/src/packets/game/c_tab_list.rs +++ b/azalea-protocol/src/packets/game/c_tab_list.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTabList { pub header: FormattedText, pub footer: FormattedText, diff --git a/azalea-protocol/src/packets/game/c_tag_query.rs b/azalea-protocol/src/packets/game/c_tag_query.rs index efd94e32..6be68856 100644 --- a/azalea-protocol/src/packets/game/c_tag_query.rs +++ b/azalea-protocol/src/packets/game/c_tag_query.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use simdnbt::owned::NbtTag; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTagQuery { #[var] pub transaction_id: u32, diff --git a/azalea-protocol/src/packets/game/c_take_item_entity.rs b/azalea-protocol/src/packets/game/c_take_item_entity.rs index cfbe33c2..09b2f7bc 100644 --- a/azalea-protocol/src/packets/game/c_take_item_entity.rs +++ b/azalea-protocol/src/packets/game/c_take_item_entity.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTakeItemEntity { #[var] pub item_id: u32, diff --git a/azalea-protocol/src/packets/game/c_teleport_entity.rs b/azalea-protocol/src/packets/game/c_teleport_entity.rs index e19ded58..8f9ea2d8 100644 --- a/azalea-protocol/src/packets/game/c_teleport_entity.rs +++ b/azalea-protocol/src/packets/game/c_teleport_entity.rs @@ -4,7 +4,7 @@ use azalea_world::MinecraftEntityId; use crate::common::movements::{PositionMoveRotation, RelativeMovements}; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTeleportEntity { #[var] pub id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_test_instance_block_status.rs b/azalea-protocol/src/packets/game/c_test_instance_block_status.rs index 9dc958c1..9d8d3182 100644 --- a/azalea-protocol/src/packets/game/c_test_instance_block_status.rs +++ b/azalea-protocol/src/packets/game/c_test_instance_block_status.rs @@ -3,7 +3,7 @@ use azalea_chat::FormattedText; use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTestInstanceBlockStatus { pub status: FormattedText, pub size: Option<Vec3>, diff --git a/azalea-protocol/src/packets/game/c_ticking_state.rs b/azalea-protocol/src/packets/game/c_ticking_state.rs index 3e4e11c2..dfab0fd5 100644 --- a/azalea-protocol/src/packets/game/c_ticking_state.rs +++ b/azalea-protocol/src/packets/game/c_ticking_state.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTickingState { pub tick_rate: f32, pub is_frozen: bool, diff --git a/azalea-protocol/src/packets/game/c_ticking_step.rs b/azalea-protocol/src/packets/game/c_ticking_step.rs index 0a151134..dd0977c1 100644 --- a/azalea-protocol/src/packets/game/c_ticking_step.rs +++ b/azalea-protocol/src/packets/game/c_ticking_step.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTickingStep { #[var] pub tick_steps: u32, diff --git a/azalea-protocol/src/packets/game/c_transfer.rs b/azalea-protocol/src/packets/game/c_transfer.rs index ad7de333..bc6e5757 100644 --- a/azalea-protocol/src/packets/game/c_transfer.rs +++ b/azalea-protocol/src/packets/game/c_transfer.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundTransfer { pub host: String, #[var] diff --git a/azalea-protocol/src/packets/game/c_update_advancements.rs b/azalea-protocol/src/packets/game/c_update_advancements.rs index 43542e56..d1b1fa80 100644 --- a/azalea-protocol/src/packets/game/c_update_advancements.rs +++ b/azalea-protocol/src/packets/game/c_update_advancements.rs @@ -1,22 +1,25 @@ -use std::collections::HashMap; -use std::io::{self, Cursor, Write}; +use std::{ + collections::HashMap, + io::{self, Cursor, Write}, +}; use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_core::resource_location::ResourceLocation; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; +use indexmap::IndexMap; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundUpdateAdvancements { pub reset: bool, pub added: Vec<AdvancementHolder>, pub removed: Vec<ResourceLocation>, - pub progress: HashMap<ResourceLocation, AdvancementProgress>, + pub progress: IndexMap<ResourceLocation, AdvancementProgress>, pub show_advancements: bool, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct Advancement { pub parent_id: Option<ResourceLocation>, pub display: Option<DisplayInfo>, @@ -24,7 +27,7 @@ pub struct Advancement { pub sends_telemetry_event: bool, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct DisplayInfo { pub title: FormattedText, pub description: FormattedText, @@ -97,7 +100,7 @@ impl azalea_buf::AzaleaRead for DisplayInfo { } } -#[derive(Clone, Debug, Copy, AzBuf)] +#[derive(Clone, Debug, Copy, AzBuf, PartialEq)] pub enum FrameType { Task = 0, Challenge = 1, @@ -106,12 +109,12 @@ pub enum FrameType { pub type AdvancementProgress = HashMap<String, CriterionProgress>; -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct CriterionProgress { pub date: Option<u64>, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct AdvancementHolder { pub id: ResourceLocation, pub value: Advancement, diff --git a/azalea-protocol/src/packets/game/c_update_attributes.rs b/azalea-protocol/src/packets/game/c_update_attributes.rs index e4b334e3..39c921b0 100644 --- a/azalea-protocol/src/packets/game/c_update_attributes.rs +++ b/azalea-protocol/src/packets/game/c_update_attributes.rs @@ -4,14 +4,14 @@ use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::Attribute; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundUpdateAttributes { #[var] pub entity_id: MinecraftEntityId, pub values: Vec<AttributeSnapshot>, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct AttributeSnapshot { pub attribute: Attribute, pub base: f64, diff --git a/azalea-protocol/src/packets/game/c_update_mob_effect.rs b/azalea-protocol/src/packets/game/c_update_mob_effect.rs index fe8e8f2e..201589fb 100644 --- a/azalea-protocol/src/packets/game/c_update_mob_effect.rs +++ b/azalea-protocol/src/packets/game/c_update_mob_effect.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::MobEffect; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundUpdateMobEffect { #[var] pub entity_id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/c_update_recipes.rs b/azalea-protocol/src/packets/game/c_update_recipes.rs index e151ae51..c425622e 100644 --- a/azalea-protocol/src/packets/game/c_update_recipes.rs +++ b/azalea-protocol/src/packets/game/c_update_recipes.rs @@ -6,7 +6,7 @@ use azalea_protocol_macros::ClientboundGamePacket; use crate::common::recipe::{Ingredient, SlotDisplayData}; -#[derive(Clone, Debug, PartialEq, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundUpdateRecipes { pub item_sets: HashMap<ResourceLocation, RecipePropertySet>, pub stonecutter_recipes: Vec<SingleInputEntry>, diff --git a/azalea-protocol/src/packets/game/c_update_tags.rs b/azalea-protocol/src/packets/game/c_update_tags.rs index 108f8772..10b5ea06 100644 --- a/azalea-protocol/src/packets/game/c_update_tags.rs +++ b/azalea-protocol/src/packets/game/c_update_tags.rs @@ -1,74 +1,9 @@ -use std::io::{self, Cursor}; -use std::ops::Deref; -use std::{collections::HashMap, io::Write}; - -use azalea_buf::{AzBuf, AzaleaReadVar, AzaleaWriteVar, BufReadError}; -use azalea_buf::{AzaleaRead, AzaleaWrite}; -use azalea_core::resource_location::ResourceLocation; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +use crate::common::tags::TagMap; + +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundUpdateTags { pub tags: TagMap, } - -#[derive(Clone, Debug)] -pub struct Tags { - pub name: ResourceLocation, - pub elements: Vec<i32>, -} - -#[derive(Clone, Debug)] -pub struct TagMap(pub HashMap<ResourceLocation, Vec<Tags>>); - -impl AzaleaRead for TagMap { - fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { - let length = u32::azalea_read_var(buf)? as usize; - let mut data = HashMap::with_capacity(length); - for _ in 0..length { - let tag_type = ResourceLocation::azalea_read(buf)?; - let tags_count = i32::azalea_read_var(buf)? as usize; - let mut tags_vec = Vec::with_capacity(tags_count); - for _ in 0..tags_count { - let tags = Tags::azalea_read(buf)?; - tags_vec.push(tags); - } - data.insert(tag_type, tags_vec); - } - Ok(TagMap(data)) - } -} - -impl AzaleaWrite for TagMap { - fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { - (self.len() as u32).azalea_write_var(buf)?; - for (k, v) in &self.0 { - k.azalea_write(buf)?; - v.azalea_write(buf)?; - } - Ok(()) - } -} -impl AzaleaRead for Tags { - fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { - let name = ResourceLocation::azalea_read(buf)?; - let elements = Vec::<i32>::azalea_read_var(buf)?; - Ok(Tags { name, elements }) - } -} - -impl AzaleaWrite for Tags { - fn azalea_write(&self, buf: &mut impl Write) -> io::Result<()> { - self.name.azalea_write(buf)?; - self.elements.azalea_write_var(buf)?; - Ok(()) - } -} - -impl Deref for TagMap { - type Target = HashMap<ResourceLocation, Vec<Tags>>; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} diff --git a/azalea-protocol/src/packets/game/c_waypoint.rs b/azalea-protocol/src/packets/game/c_waypoint.rs index 4975815e..d7c6ad91 100644 --- a/azalea-protocol/src/packets/game/c_waypoint.rs +++ b/azalea-protocol/src/packets/game/c_waypoint.rs @@ -5,33 +5,33 @@ use azalea_core::{color::RgbColor, position::Vec3i, resource_location::ResourceL use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundGamePacket)] pub struct ClientboundWaypoint { pub operation: WaypointOperation, pub waypoint: TrackedWaypoint, } -#[derive(AzBuf, Copy, Clone, Debug)] +#[derive(AzBuf, Copy, Clone, Debug, PartialEq)] pub enum WaypointOperation { Track, Untrack, Update, } -#[derive(AzBuf, Clone, Debug)] +#[derive(AzBuf, Clone, Debug, PartialEq)] pub struct TrackedWaypoint { pub identifier: WaypointIdentifier, pub icon: WaypointIcon, pub data: WaypointData, } -#[derive(AzBuf, Clone, Debug)] +#[derive(AzBuf, Clone, Debug, PartialEq)] pub enum WaypointIdentifier { String(String), Uuid(Uuid), } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct WaypointIcon { pub style: ResourceLocation, pub color: Option<RgbColor>, @@ -66,7 +66,7 @@ struct CompactRgbColor { b: u8, } -#[derive(AzBuf, Clone, Debug)] +#[derive(AzBuf, Clone, Debug, PartialEq)] pub enum WaypointData { Empty, Vec3i(Vec3i), diff --git a/azalea-protocol/src/packets/game/s_accept_teleportation.rs b/azalea-protocol/src/packets/game/s_accept_teleportation.rs index dedc125a..88ec340c 100644 --- a/azalea-protocol/src/packets/game/s_accept_teleportation.rs +++ b/azalea-protocol/src/packets/game/s_accept_teleportation.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundAcceptTeleportation { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/s_block_entity_tag_query.rs b/azalea-protocol/src/packets/game/s_block_entity_tag_query.rs index 159f12dc..04b3f733 100644 --- a/azalea-protocol/src/packets/game/s_block_entity_tag_query.rs +++ b/azalea-protocol/src/packets/game/s_block_entity_tag_query.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundBlockEntityTagQuery { #[var] pub transaction_id: u32, diff --git a/azalea-protocol/src/packets/game/s_bundle_item_selected.rs b/azalea-protocol/src/packets/game/s_bundle_item_selected.rs index 552e51f8..35c57b5f 100644 --- a/azalea-protocol/src/packets/game/s_bundle_item_selected.rs +++ b/azalea-protocol/src/packets/game/s_bundle_item_selected.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundBundleItemSelected { #[var] pub slot_id: i32, diff --git a/azalea-protocol/src/packets/game/s_change_difficulty.rs b/azalea-protocol/src/packets/game/s_change_difficulty.rs index 7dcd3c83..b01a0225 100644 --- a/azalea-protocol/src/packets/game/s_change_difficulty.rs +++ b/azalea-protocol/src/packets/game/s_change_difficulty.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::difficulty::Difficulty; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChangeDifficulty { pub difficulty: Difficulty, } diff --git a/azalea-protocol/src/packets/game/s_change_game_mode.rs b/azalea-protocol/src/packets/game/s_change_game_mode.rs index 2dfabd2d..e11725c1 100644 --- a/azalea-protocol/src/packets/game/s_change_game_mode.rs +++ b/azalea-protocol/src/packets/game/s_change_game_mode.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::game_type::GameMode; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChangeGameMode { pub mode: GameMode, } diff --git a/azalea-protocol/src/packets/game/s_chat.rs b/azalea-protocol/src/packets/game/s_chat.rs index f4049243..3abe7da9 100644 --- a/azalea-protocol/src/packets/game/s_chat.rs +++ b/azalea-protocol/src/packets/game/s_chat.rs @@ -3,7 +3,7 @@ use azalea_core::bitset::FixedBitSet; use azalea_crypto::MessageSignature; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChat { #[limit(256)] pub message: String, @@ -13,7 +13,7 @@ pub struct ServerboundChat { pub last_seen_messages: LastSeenMessagesUpdate, } -#[derive(Clone, Debug, AzBuf, Default)] +#[derive(Clone, Debug, AzBuf, Default, PartialEq)] pub struct LastSeenMessagesUpdate { #[var] pub offset: u32, diff --git a/azalea-protocol/src/packets/game/s_chat_ack.rs b/azalea-protocol/src/packets/game/s_chat_ack.rs index d4b6efd6..b0abda26 100644 --- a/azalea-protocol/src/packets/game/s_chat_ack.rs +++ b/azalea-protocol/src/packets/game/s_chat_ack.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChatAck { #[var] pub messages: u32, diff --git a/azalea-protocol/src/packets/game/s_chat_command.rs b/azalea-protocol/src/packets/game/s_chat_command.rs index 4fdab9f9..0ce308d0 100644 --- a/azalea-protocol/src/packets/game/s_chat_command.rs +++ b/azalea-protocol/src/packets/game/s_chat_command.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChatCommand { pub command: String, } diff --git a/azalea-protocol/src/packets/game/s_chat_command_signed.rs b/azalea-protocol/src/packets/game/s_chat_command_signed.rs index c20f3c6d..38a9b9f4 100644 --- a/azalea-protocol/src/packets/game/s_chat_command_signed.rs +++ b/azalea-protocol/src/packets/game/s_chat_command_signed.rs @@ -4,7 +4,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use super::s_chat::LastSeenMessagesUpdate; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChatCommandSigned { pub command: String, pub timestamp: u64, @@ -13,7 +13,7 @@ pub struct ServerboundChatCommandSigned { pub last_seen_messages: LastSeenMessagesUpdate, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct ArgumentSignature { pub name: String, pub signature: MessageSignature, diff --git a/azalea-protocol/src/packets/game/s_chat_preview.rs b/azalea-protocol/src/packets/game/s_chat_preview.rs index 3d2bf34e..4dc1a2a0 100644 --- a/azalea-protocol/src/packets/game/s_chat_preview.rs +++ b/azalea-protocol/src/packets/game/s_chat_preview.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChatPreview { pub query_id: i32, pub query: String, diff --git a/azalea-protocol/src/packets/game/s_chat_session_update.rs b/azalea-protocol/src/packets/game/s_chat_session_update.rs index f3499983..c72b87ba 100644 --- a/azalea-protocol/src/packets/game/s_chat_session_update.rs +++ b/azalea-protocol/src/packets/game/s_chat_session_update.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChatSessionUpdate { pub chat_session: RemoteChatSessionData, } diff --git a/azalea-protocol/src/packets/game/s_chunk_batch_received.rs b/azalea-protocol/src/packets/game/s_chunk_batch_received.rs index faa50932..16b58c80 100644 --- a/azalea-protocol/src/packets/game/s_chunk_batch_received.rs +++ b/azalea-protocol/src/packets/game/s_chunk_batch_received.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundChunkBatchReceived { pub desired_chunks_per_tick: f32, } diff --git a/azalea-protocol/src/packets/game/s_client_command.rs b/azalea-protocol/src/packets/game/s_client_command.rs index 5742bdb4..106a120e 100644 --- a/azalea-protocol/src/packets/game/s_client_command.rs +++ b/azalea-protocol/src/packets/game/s_client_command.rs @@ -1,12 +1,12 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundClientCommand { pub action: Action, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum Action { PerformRespawn = 0, RequestStats = 1, diff --git a/azalea-protocol/src/packets/game/s_client_information.rs b/azalea-protocol/src/packets/game/s_client_information.rs index c8e76f63..923a625c 100644 --- a/azalea-protocol/src/packets/game/s_client_information.rs +++ b/azalea-protocol/src/packets/game/s_client_information.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::common::client_information::ClientInformation; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundClientInformation { pub client_information: ClientInformation, } diff --git a/azalea-protocol/src/packets/game/s_client_tick_end.rs b/azalea-protocol/src/packets/game/s_client_tick_end.rs index 221525ec..b4e0acc4 100644 --- a/azalea-protocol/src/packets/game/s_client_tick_end.rs +++ b/azalea-protocol/src/packets/game/s_client_tick_end.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundClientTickEnd; diff --git a/azalea-protocol/src/packets/game/s_command_suggestion.rs b/azalea-protocol/src/packets/game/s_command_suggestion.rs index 2e52a969..df5a8ea9 100644 --- a/azalea-protocol/src/packets/game/s_command_suggestion.rs +++ b/azalea-protocol/src/packets/game/s_command_suggestion.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundCommandSuggestion { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs b/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs index 3e137494..2049ef1c 100644 --- a/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs +++ b/azalea-protocol/src/packets/game/s_configuration_acknowledged.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundConfigurationAcknowledged; diff --git a/azalea-protocol/src/packets/game/s_container_button_click.rs b/azalea-protocol/src/packets/game/s_container_button_click.rs index 7a27e190..0983c299 100644 --- a/azalea-protocol/src/packets/game/s_container_button_click.rs +++ b/azalea-protocol/src/packets/game/s_container_button_click.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundContainerButtonClick { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/s_container_click.rs b/azalea-protocol/src/packets/game/s_container_click.rs index a06e7c0c..ef2e832d 100644 --- a/azalea-protocol/src/packets/game/s_container_click.rs +++ b/azalea-protocol/src/packets/game/s_container_click.rs @@ -1,11 +1,10 @@ -use std::collections::HashMap; - use azalea_buf::AzBuf; use azalea_core::{checksum::Checksum, registry_holder::RegistryHolder}; use azalea_inventory::{ItemStack, operations::ClickType}; use azalea_protocol_macros::ServerboundGamePacket; +use indexmap::IndexMap; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundContainerClick { #[var] pub container_id: i32, @@ -14,16 +13,16 @@ pub struct ServerboundContainerClick { pub slot_num: i16, pub button_num: u8, pub click_type: ClickType, - pub changed_slots: HashMap<u16, HashedStack>, + pub changed_slots: IndexMap<u16, HashedStack>, pub carried_item: HashedStack, } /// Similar to an [`ItemStack`] but only carrying a CRC32 hash of the value of /// added data components instead of their entire contents. -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct HashedStack(pub Option<HashedActualItem>); -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct HashedActualItem { pub kind: azalea_registry::Item, #[var] @@ -31,10 +30,8 @@ pub struct HashedActualItem { pub components: HashedPatchMap, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct HashedPatchMap { - /// The value is a CRC32 hash of the data component's network serialization. - /// (kind + data) #[limit(256)] pub added_components: Vec<(azalea_registry::DataComponentKind, Checksum)>, #[limit(256)] diff --git a/azalea-protocol/src/packets/game/s_container_close.rs b/azalea-protocol/src/packets/game/s_container_close.rs index f19e0f2f..79e48629 100644 --- a/azalea-protocol/src/packets/game/s_container_close.rs +++ b/azalea-protocol/src/packets/game/s_container_close.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundContainerClose { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/s_container_slot_state_changed.rs b/azalea-protocol/src/packets/game/s_container_slot_state_changed.rs index c22be4de..1aedbb68 100644 --- a/azalea-protocol/src/packets/game/s_container_slot_state_changed.rs +++ b/azalea-protocol/src/packets/game/s_container_slot_state_changed.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundContainerSlotStateChanged { #[var] pub slot_id: u32, diff --git a/azalea-protocol/src/packets/game/s_cookie_response.rs b/azalea-protocol/src/packets/game/s_cookie_response.rs index 5159d72e..fd6b8a51 100644 --- a/azalea-protocol/src/packets/game/s_cookie_response.rs +++ b/azalea-protocol/src/packets/game/s_cookie_response.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundCookieResponse { pub key: ResourceLocation, pub payload: Option<Vec<u8>>, diff --git a/azalea-protocol/src/packets/game/s_custom_click_action.rs b/azalea-protocol/src/packets/game/s_custom_click_action.rs index 4822fb65..338137c4 100644 --- a/azalea-protocol/src/packets/game/s_custom_click_action.rs +++ b/azalea-protocol/src/packets/game/s_custom_click_action.rs @@ -3,7 +3,7 @@ use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; use simdnbt::owned::Nbt; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundCustomClickAction { pub id: ResourceLocation, pub payload: Nbt, diff --git a/azalea-protocol/src/packets/game/s_custom_payload.rs b/azalea-protocol/src/packets/game/s_custom_payload.rs index b32f1d24..1f2897e2 100644 --- a/azalea-protocol/src/packets/game/s_custom_payload.rs +++ b/azalea-protocol/src/packets/game/s_custom_payload.rs @@ -3,7 +3,7 @@ use azalea_buf::UnsizedByteArray; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundCustomPayload { pub identifier: ResourceLocation, pub data: UnsizedByteArray, diff --git a/azalea-protocol/src/packets/game/s_debug_sample_subscription.rs b/azalea-protocol/src/packets/game/s_debug_sample_subscription.rs index 45051793..f2b505f3 100644 --- a/azalea-protocol/src/packets/game/s_debug_sample_subscription.rs +++ b/azalea-protocol/src/packets/game/s_debug_sample_subscription.rs @@ -1,12 +1,12 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundDebugSampleSubscription { pub sample_type: RemoteDebugSampleType, } -#[derive(Clone, Copy, Debug, AzBuf)] +#[derive(Clone, Copy, Debug, AzBuf, PartialEq)] pub enum RemoteDebugSampleType { TickTime, } diff --git a/azalea-protocol/src/packets/game/s_edit_book.rs b/azalea-protocol/src/packets/game/s_edit_book.rs index af05a7cd..f99a5e0e 100644 --- a/azalea-protocol/src/packets/game/s_edit_book.rs +++ b/azalea-protocol/src/packets/game/s_edit_book.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundEditBook { #[var] pub slot: u32, diff --git a/azalea-protocol/src/packets/game/s_entity_tag_query.rs b/azalea-protocol/src/packets/game/s_entity_tag_query.rs index 4bccee83..def302e6 100644 --- a/azalea-protocol/src/packets/game/s_entity_tag_query.rs +++ b/azalea-protocol/src/packets/game/s_entity_tag_query.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundEntityTagQuery { #[var] pub transaction_id: u32, diff --git a/azalea-protocol/src/packets/game/s_interact.rs b/azalea-protocol/src/packets/game/s_interact.rs index 762afe4e..2929570d 100644 --- a/azalea-protocol/src/packets/game/s_interact.rs +++ b/azalea-protocol/src/packets/game/s_interact.rs @@ -7,7 +7,7 @@ use azalea_world::MinecraftEntityId; use crate::packets::BufReadError; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundInteract { #[var] pub entity_id: MinecraftEntityId, @@ -16,7 +16,7 @@ pub struct ServerboundInteract { pub using_secondary_action: bool, } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq)] pub enum ActionType { Interact { hand: InteractionHand, @@ -80,7 +80,7 @@ impl AzaleaRead for ActionType { } } -#[derive(AzBuf, Clone, Copy, Debug, Default)] +#[derive(AzBuf, Clone, Copy, Debug, Default, PartialEq)] pub enum InteractionHand { #[default] MainHand = 0, diff --git a/azalea-protocol/src/packets/game/s_jigsaw_generate.rs b/azalea-protocol/src/packets/game/s_jigsaw_generate.rs index 4a3b58ce..00c0cf7d 100644 --- a/azalea-protocol/src/packets/game/s_jigsaw_generate.rs +++ b/azalea-protocol/src/packets/game/s_jigsaw_generate.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundJigsawGenerate { pub pos: BlockPos, #[var] diff --git a/azalea-protocol/src/packets/game/s_keep_alive.rs b/azalea-protocol/src/packets/game/s_keep_alive.rs index a6806a92..9da1efd4 100644 --- a/azalea-protocol/src/packets/game/s_keep_alive.rs +++ b/azalea-protocol/src/packets/game/s_keep_alive.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundKeepAlive { pub id: u64, } diff --git a/azalea-protocol/src/packets/game/s_lock_difficulty.rs b/azalea-protocol/src/packets/game/s_lock_difficulty.rs index 72acb705..b874a1a0 100644 --- a/azalea-protocol/src/packets/game/s_lock_difficulty.rs +++ b/azalea-protocol/src/packets/game/s_lock_difficulty.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundLockDifficulty { pub locked: bool, } diff --git a/azalea-protocol/src/packets/game/s_move_player_pos.rs b/azalea-protocol/src/packets/game/s_move_player_pos.rs index 9f840f8e..3d4e31be 100644 --- a/azalea-protocol/src/packets/game/s_move_player_pos.rs +++ b/azalea-protocol/src/packets/game/s_move_player_pos.rs @@ -4,7 +4,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::common::movements::MoveFlags; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundMovePlayerPos { pub pos: Vec3, pub flags: MoveFlags, diff --git a/azalea-protocol/src/packets/game/s_move_player_pos_rot.rs b/azalea-protocol/src/packets/game/s_move_player_pos_rot.rs index b8ea0b9b..6c6dedec 100644 --- a/azalea-protocol/src/packets/game/s_move_player_pos_rot.rs +++ b/azalea-protocol/src/packets/game/s_move_player_pos_rot.rs @@ -5,7 +5,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::common::movements::MoveFlags; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundMovePlayerPosRot { pub pos: Vec3, pub look_direction: LookDirection, diff --git a/azalea-protocol/src/packets/game/s_move_player_rot.rs b/azalea-protocol/src/packets/game/s_move_player_rot.rs index d158af8c..54699865 100644 --- a/azalea-protocol/src/packets/game/s_move_player_rot.rs +++ b/azalea-protocol/src/packets/game/s_move_player_rot.rs @@ -4,7 +4,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::common::movements::MoveFlags; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundMovePlayerRot { pub look_direction: LookDirection, pub flags: MoveFlags, diff --git a/azalea-protocol/src/packets/game/s_move_player_status_only.rs b/azalea-protocol/src/packets/game/s_move_player_status_only.rs index 162b6b0e..eaa49bab 100644 --- a/azalea-protocol/src/packets/game/s_move_player_status_only.rs +++ b/azalea-protocol/src/packets/game/s_move_player_status_only.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::common::movements::MoveFlags; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundMovePlayerStatusOnly { pub flags: MoveFlags, } diff --git a/azalea-protocol/src/packets/game/s_move_vehicle.rs b/azalea-protocol/src/packets/game/s_move_vehicle.rs index 76eac7e1..f9a3d02b 100644 --- a/azalea-protocol/src/packets/game/s_move_vehicle.rs +++ b/azalea-protocol/src/packets/game/s_move_vehicle.rs @@ -3,7 +3,7 @@ use azalea_core::position::Vec3; use azalea_entity::LookDirection; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundMoveVehicle { pub pos: Vec3, pub look_direction: LookDirection, diff --git a/azalea-protocol/src/packets/game/s_paddle_boat.rs b/azalea-protocol/src/packets/game/s_paddle_boat.rs index eed7addc..174849f4 100644 --- a/azalea-protocol/src/packets/game/s_paddle_boat.rs +++ b/azalea-protocol/src/packets/game/s_paddle_boat.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPaddleBoat { pub left: bool, pub right: bool, diff --git a/azalea-protocol/src/packets/game/s_pick_item_from_block.rs b/azalea-protocol/src/packets/game/s_pick_item_from_block.rs index d923646b..db0a8201 100644 --- a/azalea-protocol/src/packets/game/s_pick_item_from_block.rs +++ b/azalea-protocol/src/packets/game/s_pick_item_from_block.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPickItemFromBlock { #[var] pub slot: u32, diff --git a/azalea-protocol/src/packets/game/s_pick_item_from_entity.rs b/azalea-protocol/src/packets/game/s_pick_item_from_entity.rs index 73185c9b..e91298f8 100644 --- a/azalea-protocol/src/packets/game/s_pick_item_from_entity.rs +++ b/azalea-protocol/src/packets/game/s_pick_item_from_entity.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPickItemFromEntity { #[var] pub id: MinecraftEntityId, diff --git a/azalea-protocol/src/packets/game/s_ping_request.rs b/azalea-protocol/src/packets/game/s_ping_request.rs index 1ea7550f..1c4c8adc 100644 --- a/azalea-protocol/src/packets/game/s_ping_request.rs +++ b/azalea-protocol/src/packets/game/s_ping_request.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPingRequest { pub time: u64, } diff --git a/azalea-protocol/src/packets/game/s_place_recipe.rs b/azalea-protocol/src/packets/game/s_place_recipe.rs index 84924541..fe56cd96 100644 --- a/azalea-protocol/src/packets/game/s_place_recipe.rs +++ b/azalea-protocol/src/packets/game/s_place_recipe.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPlaceRecipe { #[var] pub container_id: i32, diff --git a/azalea-protocol/src/packets/game/s_player_abilities.rs b/azalea-protocol/src/packets/game/s_player_abilities.rs index da194228..2eff36cb 100644 --- a/azalea-protocol/src/packets/game/s_player_abilities.rs +++ b/azalea-protocol/src/packets/game/s_player_abilities.rs @@ -6,7 +6,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::BufReadError; -#[derive(Clone, Debug, ServerboundGamePacket)] +#[derive(Clone, Debug, PartialEq, ServerboundGamePacket)] pub struct ServerboundPlayerAbilities { pub is_flying: bool, } diff --git a/azalea-protocol/src/packets/game/s_player_action.rs b/azalea-protocol/src/packets/game/s_player_action.rs index cffec2bd..3f129918 100644 --- a/azalea-protocol/src/packets/game/s_player_action.rs +++ b/azalea-protocol/src/packets/game/s_player_action.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::{direction::Direction, position::BlockPos}; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPlayerAction { pub action: Action, pub pos: BlockPos, @@ -11,7 +11,7 @@ pub struct ServerboundPlayerAction { pub seq: u32, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq)] pub enum Action { StartDestroyBlock = 0, AbortDestroyBlock = 1, diff --git a/azalea-protocol/src/packets/game/s_player_command.rs b/azalea-protocol/src/packets/game/s_player_command.rs index 48ce5975..f7cb5bee 100644 --- a/azalea-protocol/src/packets/game/s_player_command.rs +++ b/azalea-protocol/src/packets/game/s_player_command.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use azalea_world::MinecraftEntityId; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPlayerCommand { #[var] pub id: MinecraftEntityId, @@ -11,7 +11,7 @@ pub struct ServerboundPlayerCommand { pub data: u32, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum Action { StopSleeping, StartSprinting, diff --git a/azalea-protocol/src/packets/game/s_player_loaded.rs b/azalea-protocol/src/packets/game/s_player_loaded.rs index 3e809b26..1372aba1 100644 --- a/azalea-protocol/src/packets/game/s_player_loaded.rs +++ b/azalea-protocol/src/packets/game/s_player_loaded.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPlayerLoaded; diff --git a/azalea-protocol/src/packets/game/s_pong.rs b/azalea-protocol/src/packets/game/s_pong.rs index 10ce0fb7..2114cddc 100644 --- a/azalea-protocol/src/packets/game/s_pong.rs +++ b/azalea-protocol/src/packets/game/s_pong.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundPong { pub id: u32, } diff --git a/azalea-protocol/src/packets/game/s_recipe_book_change_settings.rs b/azalea-protocol/src/packets/game/s_recipe_book_change_settings.rs index a31ca173..5bf188ee 100644 --- a/azalea-protocol/src/packets/game/s_recipe_book_change_settings.rs +++ b/azalea-protocol/src/packets/game/s_recipe_book_change_settings.rs @@ -1,14 +1,14 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundRecipeBookChangeSettings { pub book_type: RecipeBookType, pub is_open: bool, pub is_filtering: bool, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum RecipeBookType { Crafting = 0, Furnace = 1, diff --git a/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs b/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs index 9eeffde9..7fa1da45 100644 --- a/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs +++ b/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundRecipeBookSeenRecipe { pub recipe: ResourceLocation, } diff --git a/azalea-protocol/src/packets/game/s_rename_item.rs b/azalea-protocol/src/packets/game/s_rename_item.rs index 4c913ba0..f9fcf269 100644 --- a/azalea-protocol/src/packets/game/s_rename_item.rs +++ b/azalea-protocol/src/packets/game/s_rename_item.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundRenameItem { pub name: String, } diff --git a/azalea-protocol/src/packets/game/s_resource_pack.rs b/azalea-protocol/src/packets/game/s_resource_pack.rs index 7bdb7bb4..0d0b55a7 100644 --- a/azalea-protocol/src/packets/game/s_resource_pack.rs +++ b/azalea-protocol/src/packets/game/s_resource_pack.rs @@ -2,13 +2,13 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundResourcePack { pub id: Uuid, pub action: Action, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum Action { SuccessfullyLoaded = 0, Declined = 1, diff --git a/azalea-protocol/src/packets/game/s_seen_advancements.rs b/azalea-protocol/src/packets/game/s_seen_advancements.rs index d6fef907..1c502568 100644 --- a/azalea-protocol/src/packets/game/s_seen_advancements.rs +++ b/azalea-protocol/src/packets/game/s_seen_advancements.rs @@ -6,7 +6,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::BufReadError; -#[derive(Clone, Debug, ServerboundGamePacket)] +#[derive(Clone, Debug, PartialEq, ServerboundGamePacket)] pub struct ServerboundSeenAdvancements { pub action: Action, pub tab: Option<ResourceLocation>, diff --git a/azalea-protocol/src/packets/game/s_select_trade.rs b/azalea-protocol/src/packets/game/s_select_trade.rs index e0cc8aab..2955db7a 100644 --- a/azalea-protocol/src/packets/game/s_select_trade.rs +++ b/azalea-protocol/src/packets/game/s_select_trade.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSelectTrade { #[var] pub item: u32, diff --git a/azalea-protocol/src/packets/game/s_set_beacon.rs b/azalea-protocol/src/packets/game/s_set_beacon.rs index b0b911a1..c06d888c 100644 --- a/azalea-protocol/src/packets/game/s_set_beacon.rs +++ b/azalea-protocol/src/packets/game/s_set_beacon.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetBeacon { #[var] pub primary: Option<u32>, diff --git a/azalea-protocol/src/packets/game/s_set_carried_item.rs b/azalea-protocol/src/packets/game/s_set_carried_item.rs index 5efa2d44..5d990426 100644 --- a/azalea-protocol/src/packets/game/s_set_carried_item.rs +++ b/azalea-protocol/src/packets/game/s_set_carried_item.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetCarriedItem { pub slot: u16, } diff --git a/azalea-protocol/src/packets/game/s_set_command_block.rs b/azalea-protocol/src/packets/game/s_set_command_block.rs index 89cece2c..17701171 100644 --- a/azalea-protocol/src/packets/game/s_set_command_block.rs +++ b/azalea-protocol/src/packets/game/s_set_command_block.rs @@ -6,7 +6,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::AzaleaWrite; -#[derive(Clone, Debug, ServerboundGamePacket)] +#[derive(Clone, Debug, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetCommandBlock { pub pos: BlockPos, pub command: String, @@ -17,7 +17,7 @@ pub struct ServerboundSetCommandBlock { pub automatic: bool, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum Mode { Sequence = 0, Auto = 1, diff --git a/azalea-protocol/src/packets/game/s_set_command_minecart.rs b/azalea-protocol/src/packets/game/s_set_command_minecart.rs index 0431a865..88e6e74e 100644 --- a/azalea-protocol/src/packets/game/s_set_command_minecart.rs +++ b/azalea-protocol/src/packets/game/s_set_command_minecart.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetCommandMinecart { #[var] pub entity: u32, diff --git a/azalea-protocol/src/packets/game/s_set_creative_mode_slot.rs b/azalea-protocol/src/packets/game/s_set_creative_mode_slot.rs index e4b26a64..5e06f424 100644 --- a/azalea-protocol/src/packets/game/s_set_creative_mode_slot.rs +++ b/azalea-protocol/src/packets/game/s_set_creative_mode_slot.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetCreativeModeSlot { pub slot_num: u16, pub item_stack: ItemStack, diff --git a/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs b/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs index 8c218ffd..8999faf4 100644 --- a/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs +++ b/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs @@ -1,17 +1,15 @@ -use std::io; -use std::io::Cursor; -use std::io::Write; +use std::{ + io, + io::{Cursor, Write}, +}; -use azalea_buf::AzBuf; -use azalea_buf::AzaleaRead; -use azalea_core::position::BlockPos; -use azalea_core::resource_location::ResourceLocation; +use azalea_buf::{AzBuf, AzaleaRead}; +use azalea_core::{position::BlockPos, resource_location::ResourceLocation}; use azalea_protocol_macros::ServerboundGamePacket; -use crate::packets::AzaleaWrite; -use crate::packets::BufReadError; +use crate::packets::{AzaleaWrite, BufReadError}; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetJigsawBlock { pub pos: BlockPos, pub name: ResourceLocation, diff --git a/azalea-protocol/src/packets/game/s_set_structure_block.rs b/azalea-protocol/src/packets/game/s_set_structure_block.rs index 8d518292..401116a1 100644 --- a/azalea-protocol/src/packets/game/s_set_structure_block.rs +++ b/azalea-protocol/src/packets/game/s_set_structure_block.rs @@ -1,13 +1,12 @@ use std::io::{self, Cursor, Write}; -use azalea_buf::AzBuf; -use azalea_buf::{AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; use azalea_core::{bitset::FixedBitSet, position::BlockPos}; use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::BufReadError; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetStructureBlock { pub pos: BlockPos, pub update_type: UpdateType, @@ -24,14 +23,14 @@ pub struct ServerboundSetStructureBlock { pub flags: Flags, } -#[derive(Clone, Debug, AzBuf)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct BytePosition { pub x: u8, pub y: u8, pub z: u8, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum UpdateType { UpdateData = 0, SaveArea = 1, @@ -39,7 +38,7 @@ pub enum UpdateType { ScanArea = 3, } -#[derive(AzBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq)] pub enum StructureMode { Save = 0, Load = 1, @@ -47,7 +46,7 @@ pub enum StructureMode { Data = 3, } -#[derive(AzBuf, Clone, Copy, Debug, Default)] +#[derive(AzBuf, Clone, Copy, Debug, Default, PartialEq)] pub enum Mirror { #[default] None = 0, @@ -55,7 +54,7 @@ pub enum Mirror { FrontBack = 2, } -#[derive(AzBuf, Clone, Copy, Debug, Default)] +#[derive(AzBuf, Clone, Copy, Debug, Default, PartialEq)] pub enum Rotation { #[default] None = 0, @@ -64,7 +63,7 @@ pub enum Rotation { Counterclockwise90 = 3, } -#[derive(Debug, Clone)] +#[derive(Debug, Clone, PartialEq)] pub struct Flags { pub ignore_entities: bool, pub show_air: bool, diff --git a/azalea-protocol/src/packets/game/s_set_test_block.rs b/azalea-protocol/src/packets/game/s_set_test_block.rs index 579b689e..afa456e6 100644 --- a/azalea-protocol/src/packets/game/s_set_test_block.rs +++ b/azalea-protocol/src/packets/game/s_set_test_block.rs @@ -2,14 +2,14 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSetTestBlock { pub position: BlockPos, pub mode: TestBlockMode, pub message: String, } -#[derive(Clone, Copy, Debug, AzBuf, Default)] +#[derive(Clone, Copy, Debug, AzBuf, Default, PartialEq)] pub enum TestBlockMode { #[default] Start, diff --git a/azalea-protocol/src/packets/game/s_sign_update.rs b/azalea-protocol/src/packets/game/s_sign_update.rs index c43a0978..85cb1d6f 100644 --- a/azalea-protocol/src/packets/game/s_sign_update.rs +++ b/azalea-protocol/src/packets/game/s_sign_update.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSignUpdate { pub pos: BlockPos, pub is_front_text: bool, diff --git a/azalea-protocol/src/packets/game/s_swing.rs b/azalea-protocol/src/packets/game/s_swing.rs index 68648ac6..ab336260 100644 --- a/azalea-protocol/src/packets/game/s_swing.rs +++ b/azalea-protocol/src/packets/game/s_swing.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::game::s_interact::InteractionHand; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundSwing { pub hand: InteractionHand, } diff --git a/azalea-protocol/src/packets/game/s_teleport_to_entity.rs b/azalea-protocol/src/packets/game/s_teleport_to_entity.rs index e8829530..a70d0c85 100644 --- a/azalea-protocol/src/packets/game/s_teleport_to_entity.rs +++ b/azalea-protocol/src/packets/game/s_teleport_to_entity.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundTeleportToEntity { pub uuid: Uuid, } diff --git a/azalea-protocol/src/packets/game/s_test_instance_block_action.rs b/azalea-protocol/src/packets/game/s_test_instance_block_action.rs index 62a3bf4c..eacf18a6 100644 --- a/azalea-protocol/src/packets/game/s_test_instance_block_action.rs +++ b/azalea-protocol/src/packets/game/s_test_instance_block_action.rs @@ -6,14 +6,14 @@ use azalea_registry::TestInstanceKind; use super::s_set_structure_block::Rotation; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundTestInstanceBlockAction { pub pos: BlockPos, pub action: Action, pub data: TestInstanceBlockEntityData, } -#[derive(Clone, Copy, Debug, AzBuf, Default)] +#[derive(Clone, Copy, Debug, AzBuf, Default, PartialEq)] pub enum Action { #[default] Init, @@ -25,7 +25,7 @@ pub enum Action { Run, } -#[derive(Clone, Debug, AzBuf, Default)] +#[derive(Clone, Debug, AzBuf, Default, PartialEq)] pub struct TestInstanceBlockEntityData { pub test: Option<TestInstanceKind>, pub size: Vec3i, @@ -35,7 +35,7 @@ pub struct TestInstanceBlockEntityData { pub error_message: Option<FormattedText>, } -#[derive(Clone, Copy, Debug, AzBuf, Default)] +#[derive(Clone, Copy, Debug, AzBuf, Default, PartialEq)] pub enum TestInstanceBlockEntityStatus { #[default] Cleared, diff --git a/azalea-protocol/src/packets/game/s_use_item.rs b/azalea-protocol/src/packets/game/s_use_item.rs index 3e9e1a2f..e7be84bc 100644 --- a/azalea-protocol/src/packets/game/s_use_item.rs +++ b/azalea-protocol/src/packets/game/s_use_item.rs @@ -3,7 +3,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::game::s_interact::InteractionHand; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundUseItem { pub hand: InteractionHand, #[var] diff --git a/azalea-protocol/src/packets/game/s_use_item_on.rs b/azalea-protocol/src/packets/game/s_use_item_on.rs index 1c08112d..e97d8aaf 100644 --- a/azalea-protocol/src/packets/game/s_use_item_on.rs +++ b/azalea-protocol/src/packets/game/s_use_item_on.rs @@ -10,7 +10,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::game::s_interact::InteractionHand; -#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundGamePacket)] pub struct ServerboundUseItemOn { pub hand: InteractionHand, pub block_hit: BlockHit, @@ -18,7 +18,7 @@ pub struct ServerboundUseItemOn { pub seq: u32, } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq)] pub struct BlockHit { /// The block that we clicked. pub block_pos: BlockPos, diff --git a/azalea-protocol/src/packets/handshake/s_intention.rs b/azalea-protocol/src/packets/handshake/s_intention.rs index 566ada30..30d74f5d 100644 --- a/azalea-protocol/src/packets/handshake/s_intention.rs +++ b/azalea-protocol/src/packets/handshake/s_intention.rs @@ -5,7 +5,7 @@ use azalea_protocol_macros::ServerboundHandshakePacket; use crate::packets::ClientIntention; -#[derive(Hash, Clone, Debug, AzBuf, ServerboundHandshakePacket)] +#[derive(Hash, Clone, Debug, AzBuf, PartialEq, ServerboundHandshakePacket)] pub struct ServerboundIntention { #[var] pub protocol_version: i32, diff --git a/azalea-protocol/src/packets/login/c_cookie_request.rs b/azalea-protocol/src/packets/login/c_cookie_request.rs index d0bb0cd7..2574d718 100644 --- a/azalea-protocol/src/packets/login/c_cookie_request.rs +++ b/azalea-protocol/src/packets/login/c_cookie_request.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Clone, Debug, AzBuf, ClientboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundLoginPacket)] pub struct ClientboundCookieRequest { pub key: ResourceLocation, } diff --git a/azalea-protocol/src/packets/login/c_custom_query.rs b/azalea-protocol/src/packets/login/c_custom_query.rs index 80c698e6..c74d6e21 100644 --- a/azalea-protocol/src/packets/login/c_custom_query.rs +++ b/azalea-protocol/src/packets/login/c_custom_query.rs @@ -4,7 +4,7 @@ use azalea_buf::{AzBuf, UnsizedByteArray}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Hash, Clone, Debug, AzBuf, ClientboundLoginPacket)] +#[derive(Hash, Clone, Debug, AzBuf, PartialEq, ClientboundLoginPacket)] pub struct ClientboundCustomQuery { #[var] pub transaction_id: u32, diff --git a/azalea-protocol/src/packets/login/c_hello.rs b/azalea-protocol/src/packets/login/c_hello.rs index 6011ec23..0057397c 100644 --- a/azalea-protocol/src/packets/login/c_hello.rs +++ b/azalea-protocol/src/packets/login/c_hello.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Clone, Debug, AzBuf, ClientboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundLoginPacket)] pub struct ClientboundHello { #[limit(20)] pub server_id: String, diff --git a/azalea-protocol/src/packets/login/c_login_compression.rs b/azalea-protocol/src/packets/login/c_login_compression.rs index c53e3829..7294c8a5 100644 --- a/azalea-protocol/src/packets/login/c_login_compression.rs +++ b/azalea-protocol/src/packets/login/c_login_compression.rs @@ -3,7 +3,7 @@ use std::hash::Hash; use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Hash, Clone, Debug, ClientboundLoginPacket, AzBuf)] +#[derive(Hash, Clone, Debug, AzBuf, PartialEq, ClientboundLoginPacket)] pub struct ClientboundLoginCompression { #[var] pub compression_threshold: i32, diff --git a/azalea-protocol/src/packets/login/c_login_disconnect.rs b/azalea-protocol/src/packets/login/c_login_disconnect.rs index 699801be..7f8dd5f0 100644 --- a/azalea-protocol/src/packets/login/c_login_disconnect.rs +++ b/azalea-protocol/src/packets/login/c_login_disconnect.rs @@ -6,7 +6,7 @@ use azalea_protocol_macros::ClientboundLoginPacket; use serde::{Deserialize, Serialize}; use tracing::trace; -#[derive(Clone, Debug, ClientboundLoginPacket)] +#[derive(Clone, Debug, PartialEq, ClientboundLoginPacket)] pub struct ClientboundLoginDisconnect { pub reason: FormattedText, } diff --git a/azalea-protocol/src/packets/login/c_login_finished.rs b/azalea-protocol/src/packets/login/c_login_finished.rs index 482ea53f..ecc79ff0 100644 --- a/azalea-protocol/src/packets/login/c_login_finished.rs +++ b/azalea-protocol/src/packets/login/c_login_finished.rs @@ -2,7 +2,7 @@ use azalea_auth::game_profile::GameProfile; use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Clone, Debug, AzBuf, ClientboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundLoginPacket)] pub struct ClientboundLoginFinished { pub game_profile: GameProfile, } diff --git a/azalea-protocol/src/packets/login/s_cookie_response.rs b/azalea-protocol/src/packets/login/s_cookie_response.rs index 5e757600..8a7af784 100644 --- a/azalea-protocol/src/packets/login/s_cookie_response.rs +++ b/azalea-protocol/src/packets/login/s_cookie_response.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundLoginPacket)] pub struct ServerboundCookieResponse { pub key: ResourceLocation, pub payload: Option<Vec<u8>>, diff --git a/azalea-protocol/src/packets/login/s_custom_query_answer.rs b/azalea-protocol/src/packets/login/s_custom_query_answer.rs index 34820294..af0c4237 100644 --- a/azalea-protocol/src/packets/login/s_custom_query_answer.rs +++ b/azalea-protocol/src/packets/login/s_custom_query_answer.rs @@ -3,7 +3,7 @@ use std::hash::Hash; use azalea_buf::{AzBuf, UnsizedByteArray}; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Hash, Clone, Debug, AzBuf, ServerboundLoginPacket)] +#[derive(Hash, Clone, Debug, AzBuf, PartialEq, ServerboundLoginPacket)] pub struct ServerboundCustomQueryAnswer { #[var] pub transaction_id: u32, diff --git a/azalea-protocol/src/packets/login/s_hello.rs b/azalea-protocol/src/packets/login/s_hello.rs index bae1947b..86fc9f49 100644 --- a/azalea-protocol/src/packets/login/s_hello.rs +++ b/azalea-protocol/src/packets/login/s_hello.rs @@ -2,7 +2,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundLoginPacket; use uuid::Uuid; -#[derive(Clone, Debug, PartialEq, Eq, AzBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, Eq, AzBuf, PartialEq, ServerboundLoginPacket)] pub struct ServerboundHello { #[limit(16)] pub name: String, diff --git a/azalea-protocol/src/packets/login/s_key.rs b/azalea-protocol/src/packets/login/s_key.rs index 1b96d445..a3a404c6 100644 --- a/azalea-protocol/src/packets/login/s_key.rs +++ b/azalea-protocol/src/packets/login/s_key.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundLoginPacket)] pub struct ServerboundKey { pub key_bytes: Vec<u8>, pub encrypted_challenge: Vec<u8>, diff --git a/azalea-protocol/src/packets/login/s_login_acknowledged.rs b/azalea-protocol/src/packets/login/s_login_acknowledged.rs index 263d58c6..da1c0f9f 100644 --- a/azalea-protocol/src/packets/login/s_login_acknowledged.rs +++ b/azalea-protocol/src/packets/login/s_login_acknowledged.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundLoginPacket)] pub struct ServerboundLoginAcknowledged; diff --git a/azalea-protocol/src/packets/status/c_pong_response.rs b/azalea-protocol/src/packets/status/c_pong_response.rs index 34a5e73b..1adcfafe 100644 --- a/azalea-protocol/src/packets/status/c_pong_response.rs +++ b/azalea-protocol/src/packets/status/c_pong_response.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundStatusPacket; -#[derive(Clone, Debug, AzBuf, ClientboundStatusPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ClientboundStatusPacket)] pub struct ClientboundPongResponse { pub time: u64, } diff --git a/azalea-protocol/src/packets/status/c_status_response.rs b/azalea-protocol/src/packets/status/c_status_response.rs index 5121f317..6505167e 100644 --- a/azalea-protocol/src/packets/status/c_status_response.rs +++ b/azalea-protocol/src/packets/status/c_status_response.rs @@ -6,19 +6,19 @@ use azalea_protocol_macros::ClientboundStatusPacket; use serde::{Deserialize, Serialize}; use serde_json::value::Serializer; -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct Version { pub name: String, pub protocol: i32, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct SamplePlayer { pub id: String, pub name: String, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct Players { pub max: i32, pub online: i32, @@ -27,7 +27,7 @@ pub struct Players { } // the entire packet is just json, which is why it has deserialize -#[derive(Clone, Debug, Serialize, Deserialize, ClientboundStatusPacket)] +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, ClientboundStatusPacket)] pub struct ClientboundStatusResponse { pub description: FormattedText, #[serde(default)] diff --git a/azalea-protocol/src/packets/status/s_ping_request.rs b/azalea-protocol/src/packets/status/s_ping_request.rs index 34f2e062..90c09e3e 100644 --- a/azalea-protocol/src/packets/status/s_ping_request.rs +++ b/azalea-protocol/src/packets/status/s_ping_request.rs @@ -1,7 +1,7 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundStatusPacket; -#[derive(Clone, Debug, AzBuf, ServerboundStatusPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundStatusPacket)] pub struct ServerboundPingRequest { pub time: u64, } diff --git a/azalea-protocol/src/packets/status/s_status_request.rs b/azalea-protocol/src/packets/status/s_status_request.rs index 53fdbcaa..1119c1de 100644 --- a/azalea-protocol/src/packets/status/s_status_request.rs +++ b/azalea-protocol/src/packets/status/s_status_request.rs @@ -1,5 +1,5 @@ use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundStatusPacket; -#[derive(Clone, Debug, AzBuf, ServerboundStatusPacket)] +#[derive(Clone, Debug, AzBuf, PartialEq, ServerboundStatusPacket)] pub struct ServerboundStatusRequest; |
