From 35441c33fa716f2bf92a6532e986b5e8846b3d60 Mon Sep 17 00:00:00 2001 From: mat Date: Wed, 27 Nov 2024 02:10:14 +0000 Subject: [PATCH] McBuf -> AzBuf --- azalea-auth/src/game_profile.rs | 6 +- .../src/suggestion/suggestions.rs | 4 +- azalea-buf/azalea-buf-macros/Cargo.toml | 2 +- azalea-buf/azalea-buf-macros/src/lib.rs | 4 +- azalea-buf/azalea-buf-macros/src/read.rs | 4 +- azalea-buf/azalea-buf-macros/src/write.rs | 4 +- azalea-chat/src/style.rs | 4 +- azalea-client/src/chat.rs | 26 +-- azalea-client/src/events.rs | 4 +- azalea-client/src/packet_handling/game.rs | 8 +- azalea-core/src/bitset.rs | 4 +- azalea-core/src/delta.rs | 4 +- azalea-core/src/direction.rs | 6 +- azalea-core/src/objectives.rs | 4 +- azalea-core/src/position.rs | 4 +- azalea-core/src/resource_location.rs | 4 +- azalea-crypto/src/signing.rs | 8 +- azalea-entity/src/attributes.rs | 6 +- azalea-entity/src/data.rs | 16 +- azalea-entity/src/particle.rs | 18 +- azalea-inventory/src/components.rs | 176 +++++++++--------- azalea-inventory/src/operations.rs | 4 +- azalea-protocol/README.md | 2 +- azalea-protocol/src/common.rs | 10 +- azalea-protocol/src/packets/common.rs | 4 +- .../src/packets/config/c_cookie_request.rs | 4 +- .../src/packets/config/c_custom_payload.rs | 4 +- .../src/packets/config/c_disconnect.rs | 4 +- .../packets/config/c_finish_configuration.rs | 4 +- .../src/packets/config/c_keep_alive.rs | 4 +- azalea-protocol/src/packets/config/c_ping.rs | 4 +- .../src/packets/config/c_registry_data.rs | 4 +- .../src/packets/config/c_reset_chat.rs | 4 +- .../src/packets/config/c_resource_pack.rs | 4 +- .../src/packets/config/c_resource_pack_pop.rs | 4 +- .../packets/config/c_resource_pack_push.rs | 4 +- .../packets/config/c_select_known_packs.rs | 4 +- .../src/packets/config/c_store_cookie.rs | 4 +- .../src/packets/config/c_transfer.rs | 4 +- .../config/c_update_enabled_features.rs | 4 +- .../src/packets/config/c_update_tags.rs | 4 +- .../packets/config/s_client_information.rs | 4 +- .../src/packets/config/s_cookie_response.rs | 4 +- .../src/packets/config/s_custom_payload.rs | 4 +- .../packets/config/s_finish_configuration.rs | 4 +- .../src/packets/config/s_keep_alive.rs | 4 +- azalea-protocol/src/packets/config/s_pong.rs | 4 +- .../src/packets/config/s_resource_pack.rs | 6 +- .../packets/config/s_select_known_packs.rs | 6 +- .../src/packets/game/c_add_entity.rs | 4 +- .../src/packets/game/c_add_experience_orb.rs | 4 +- .../src/packets/game/c_add_player.rs | 4 +- azalea-protocol/src/packets/game/c_animate.rs | 6 +- .../src/packets/game/c_award_stats.rs | 6 +- .../src/packets/game/c_block_changed_ack.rs | 4 +- .../src/packets/game/c_block_destruction.rs | 4 +- .../src/packets/game/c_block_entity_data.rs | 4 +- .../src/packets/game/c_block_event.rs | 4 +- .../src/packets/game/c_block_update.rs | 4 +- .../src/packets/game/c_boss_event.rs | 14 +- azalea-protocol/src/packets/game/c_bundle.rs | 4 +- .../src/packets/game/c_change_difficulty.rs | 4 +- .../src/packets/game/c_chat_preview.rs | 4 +- .../packets/game/c_chunk_batch_finished.rs | 4 +- .../src/packets/game/c_chunk_batch_start.rs | 4 +- .../src/packets/game/c_chunks_biomes.rs | 6 +- .../src/packets/game/c_clear_titles.rs | 4 +- .../src/packets/game/c_command_suggestions.rs | 4 +- .../src/packets/game/c_commands.rs | 10 +- .../src/packets/game/c_container_close.rs | 4 +- .../packets/game/c_container_set_content.rs | 4 +- .../src/packets/game/c_container_set_data.rs | 4 +- .../src/packets/game/c_container_set_slot.rs | 4 +- .../src/packets/game/c_cookie_request.rs | 4 +- .../src/packets/game/c_cooldown.rs | 4 +- .../packets/game/c_custom_chat_completions.rs | 6 +- .../src/packets/game/c_custom_payload.rs | 4 +- .../packets/game/c_custom_report_details.rs | 4 +- .../src/packets/game/c_custom_sound.rs | 6 +- .../src/packets/game/c_damage_event.rs | 4 +- .../src/packets/game/c_debug_sample.rs | 4 +- .../src/packets/game/c_delete_chat.rs | 4 +- .../src/packets/game/c_disconnect.rs | 4 +- .../src/packets/game/c_disguised_chat.rs | 4 +- .../src/packets/game/c_entity_event.rs | 4 +- .../packets/game/c_entity_position_sync.rs | 6 +- azalea-protocol/src/packets/game/c_explode.rs | 6 +- .../src/packets/game/c_forget_level_chunk.rs | 4 +- .../src/packets/game/c_game_event.rs | 6 +- .../src/packets/game/c_horse_screen_open.rs | 4 +- .../src/packets/game/c_hurt_animation.rs | 4 +- .../src/packets/game/c_initialize_border.rs | 4 +- .../src/packets/game/c_keep_alive.rs | 4 +- .../packets/game/c_level_chunk_with_light.rs | 8 +- .../src/packets/game/c_level_event.rs | 4 +- .../src/packets/game/c_level_particles.rs | 4 +- .../src/packets/game/c_light_update.rs | 6 +- azalea-protocol/src/packets/game/c_login.rs | 4 +- .../src/packets/game/c_map_item_data.rs | 10 +- .../src/packets/game/c_merchant_offers.rs | 6 +- .../src/packets/game/c_move_entity_pos.rs | 4 +- .../src/packets/game/c_move_entity_pos_rot.rs | 4 +- .../src/packets/game/c_move_entity_rot.rs | 4 +- .../src/packets/game/c_move_minecart.rs | 6 +- .../src/packets/game/c_move_vehicle.rs | 4 +- .../src/packets/game/c_open_book.rs | 4 +- .../src/packets/game/c_open_screen.rs | 4 +- .../src/packets/game/c_open_sign_editor.rs | 4 +- azalea-protocol/src/packets/game/c_ping.rs | 4 +- .../src/packets/game/c_place_ghost_recipe.rs | 4 +- .../src/packets/game/c_player_abilities.rs | 4 +- .../src/packets/game/c_player_chat.rs | 16 +- .../src/packets/game/c_player_chat_header.rs | 4 +- .../src/packets/game/c_player_combat_end.rs | 4 +- .../src/packets/game/c_player_combat_enter.rs | 4 +- .../src/packets/game/c_player_combat_kill.rs | 4 +- .../src/packets/game/c_player_info_remove.rs | 4 +- .../src/packets/game/c_player_info_update.rs | 18 +- .../src/packets/game/c_player_look_at.rs | 8 +- .../src/packets/game/c_player_position.rs | 4 +- .../src/packets/game/c_player_rotation.rs | 4 +- .../src/packets/game/c_pong_response.rs | 4 +- .../src/packets/game/c_projectile_power.rs | 4 +- .../src/packets/game/c_recipe_book_add.rs | 20 +- .../src/packets/game/c_recipe_book_remove.rs | 4 +- .../packets/game/c_recipe_book_settings.rs | 6 +- .../src/packets/game/c_remove_entities.rs | 4 +- .../src/packets/game/c_remove_mob_effect.rs | 4 +- .../src/packets/game/c_reset_score.rs | 4 +- .../src/packets/game/c_resource_pack_pop.rs | 4 +- .../src/packets/game/c_resource_pack_push.rs | 4 +- azalea-protocol/src/packets/game/c_respawn.rs | 4 +- .../src/packets/game/c_rotate_head.rs | 4 +- .../packets/game/c_section_blocks_update.rs | 6 +- .../packets/game/c_select_advancements_tab.rs | 4 +- .../src/packets/game/c_server_data.rs | 4 +- .../src/packets/game/c_server_links.rs | 10 +- .../src/packets/game/c_set_action_bar_text.rs | 4 +- .../src/packets/game/c_set_border_center.rs | 4 +- .../packets/game/c_set_border_lerp_size.rs | 4 +- .../src/packets/game/c_set_border_size.rs | 4 +- .../game/c_set_border_warning_delay.rs | 4 +- .../game/c_set_border_warning_distance.rs | 4 +- .../src/packets/game/c_set_camera.rs | 4 +- .../packets/game/c_set_chunk_cache_center.rs | 4 +- .../packets/game/c_set_chunk_cache_radius.rs | 4 +- .../src/packets/game/c_set_cursor_item.rs | 4 +- .../game/c_set_default_spawn_position.rs | 4 +- .../game/c_set_display_chat_preview.rs | 4 +- .../packets/game/c_set_display_objective.rs | 6 +- .../src/packets/game/c_set_entity_data.rs | 4 +- .../src/packets/game/c_set_entity_link.rs | 4 +- .../src/packets/game/c_set_entity_motion.rs | 4 +- .../src/packets/game/c_set_equipment.rs | 6 +- .../src/packets/game/c_set_experience.rs | 4 +- .../src/packets/game/c_set_health.rs | 4 +- .../src/packets/game/c_set_held_slot.rs | 4 +- .../src/packets/game/c_set_objective.rs | 6 +- .../src/packets/game/c_set_passengers.rs | 4 +- .../packets/game/c_set_player_inventory.rs | 4 +- .../src/packets/game/c_set_player_team.rs | 6 +- .../src/packets/game/c_set_score.rs | 4 +- .../packets/game/c_set_simulation_distance.rs | 4 +- .../src/packets/game/c_set_subtitle_text.rs | 4 +- .../src/packets/game/c_set_time.rs | 4 +- .../src/packets/game/c_set_title_text.rs | 4 +- .../packets/game/c_set_titles_animation.rs | 4 +- azalea-protocol/src/packets/game/c_sound.rs | 6 +- .../src/packets/game/c_sound_entity.rs | 6 +- .../src/packets/game/c_start_configuration.rs | 4 +- .../src/packets/game/c_store_cookie.rs | 4 +- .../src/packets/game/c_system_chat.rs | 4 +- .../src/packets/game/c_tab_list.rs | 4 +- .../src/packets/game/c_tag_query.rs | 4 +- .../src/packets/game/c_take_item_entity.rs | 4 +- .../src/packets/game/c_teleport_entity.rs | 4 +- .../src/packets/game/c_ticking_state.rs | 4 +- .../src/packets/game/c_ticking_step.rs | 4 +- .../src/packets/game/c_transfer.rs | 4 +- .../src/packets/game/c_update_advancements.rs | 12 +- .../src/packets/game/c_update_attributes.rs | 6 +- .../packets/game/c_update_enabled_features.rs | 4 +- .../src/packets/game/c_update_mob_effect.rs | 4 +- .../src/packets/game/c_update_recipes.rs | 26 +-- .../src/packets/game/c_update_tags.rs | 4 +- .../packets/game/s_accept_teleportation.rs | 4 +- .../packets/game/s_block_entity_tag_query.rs | 4 +- .../src/packets/game/s_change_difficulty.rs | 4 +- azalea-protocol/src/packets/game/s_chat.rs | 6 +- .../src/packets/game/s_chat_ack.rs | 4 +- .../src/packets/game/s_chat_command.rs | 4 +- .../src/packets/game/s_chat_command_signed.rs | 6 +- .../src/packets/game/s_chat_preview.rs | 4 +- .../src/packets/game/s_chat_session_update.rs | 8 +- .../packets/game/s_chunk_batch_received.rs | 4 +- .../src/packets/game/s_client_command.rs | 6 +- .../src/packets/game/s_client_information.rs | 4 +- .../src/packets/game/s_client_tick_end.rs | 4 +- .../src/packets/game/s_command_suggestion.rs | 4 +- .../game/s_configuration_acknowledged.rs | 4 +- .../packets/game/s_container_button_click.rs | 4 +- .../src/packets/game/s_container_click.rs | 4 +- .../src/packets/game/s_container_close.rs | 4 +- .../game/s_container_slot_state_changed.rs | 4 +- .../src/packets/game/s_cookie_response.rs | 4 +- .../src/packets/game/s_custom_payload.rs | 4 +- .../game/s_debug_sample_subscription.rs | 6 +- .../src/packets/game/s_edit_book.rs | 4 +- .../src/packets/game/s_entity_tag_query.rs | 4 +- .../src/packets/game/s_interact.rs | 6 +- .../src/packets/game/s_jigsaw_generate.rs | 4 +- .../src/packets/game/s_keep_alive.rs | 4 +- .../src/packets/game/s_lock_difficulty.rs | 4 +- .../src/packets/game/s_move_player_pos.rs | 4 +- .../src/packets/game/s_move_player_pos_rot.rs | 4 +- .../src/packets/game/s_move_player_rot.rs | 4 +- .../packets/game/s_move_player_status_only.rs | 4 +- .../src/packets/game/s_move_vehicle.rs | 4 +- .../src/packets/game/s_paddle_boat.rs | 4 +- .../src/packets/game/s_pick_item.rs | 4 +- .../src/packets/game/s_ping_request.rs | 4 +- .../src/packets/game/s_place_recipe.rs | 4 +- .../src/packets/game/s_player_action.rs | 6 +- .../src/packets/game/s_player_command.rs | 6 +- azalea-protocol/src/packets/game/s_pong.rs | 4 +- .../game/s_recipe_book_change_settings.rs | 6 +- .../packets/game/s_recipe_book_seen_recipe.rs | 4 +- .../src/packets/game/s_rename_item.rs | 4 +- .../src/packets/game/s_resource_pack.rs | 6 +- .../src/packets/game/s_seen_advancements.rs | 4 +- .../src/packets/game/s_select_bundle_item.rs | 4 +- .../src/packets/game/s_select_trade.rs | 4 +- .../src/packets/game/s_set_beacon.rs | 4 +- .../src/packets/game/s_set_carried_item.rs | 4 +- .../src/packets/game/s_set_command_block.rs | 4 +- .../packets/game/s_set_command_minecart.rs | 4 +- .../packets/game/s_set_creative_mode_slot.rs | 4 +- .../src/packets/game/s_set_jigsaw_block.rs | 6 +- .../src/packets/game/s_set_structure_block.rs | 14 +- .../src/packets/game/s_sign_update.rs | 4 +- azalea-protocol/src/packets/game/s_swing.rs | 4 +- .../src/packets/game/s_teleport_to_entity.rs | 4 +- .../src/packets/game/s_use_item.rs | 4 +- .../src/packets/game/s_use_item_on.rs | 4 +- .../packets/handshake/s_client_intention.rs | 4 +- .../src/packets/login/c_cookie_request.rs | 4 +- .../src/packets/login/c_custom_query.rs | 4 +- azalea-protocol/src/packets/login/c_hello.rs | 4 +- .../src/packets/login/c_login_compression.rs | 4 +- .../src/packets/login/c_login_finished.rs | 4 +- .../src/packets/login/s_cookie_response.rs | 4 +- .../src/packets/login/s_custom_query.rs | 4 +- .../packets/login/s_custom_query_answer.rs | 4 +- azalea-protocol/src/packets/login/s_hello.rs | 4 +- azalea-protocol/src/packets/login/s_key.rs | 4 +- .../src/packets/login/s_login_acknowledged.rs | 4 +- .../src/packets/status/c_pong_response.rs | 4 +- .../src/packets/status/s_ping_request.rs | 4 +- .../src/packets/status/s_status_request.rs | 4 +- .../azalea-registry-macros/src/lib.rs | 2 +- azalea/examples/testbot/commands.rs | 4 +- azalea/src/swarm/chat.rs | 30 +-- azalea/src/swarm/mod.rs | 4 +- codegen/README.md | 2 +- codegen/genitemcomponents.py | 2 +- codegen/lib/code/packet.py | 4 +- codegen/lib/code/utils.py | 2 +- 267 files changed, 748 insertions(+), 760 deletions(-) diff --git a/azalea-auth/src/game_profile.rs b/azalea-auth/src/game_profile.rs index 31650754..af00712d 100755 --- a/azalea-auth/src/game_profile.rs +++ b/azalea-auth/src/game_profile.rs @@ -1,10 +1,10 @@ use std::collections::HashMap; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use serde::{Deserialize, Serialize}; use uuid::Uuid; -#[derive(McBuf, Debug, Clone, Default, Eq, PartialEq)] +#[derive(AzBuf, Debug, Clone, Default, Eq, PartialEq)] pub struct GameProfile { /// The UUID of the player. pub uuid: Uuid, @@ -43,7 +43,7 @@ impl From for GameProfile { } } -#[derive(McBuf, Debug, Clone, Eq, PartialEq)] +#[derive(AzBuf, Debug, Clone, Eq, PartialEq)] pub struct ProfilePropertyValue { pub value: String, pub signature: Option, diff --git a/azalea-brigadier/src/suggestion/suggestions.rs b/azalea-brigadier/src/suggestion/suggestions.rs index 2eb904f2..d6368f44 100755 --- a/azalea-brigadier/src/suggestion/suggestions.rs +++ b/azalea-brigadier/src/suggestion/suggestions.rs @@ -4,7 +4,7 @@ use std::{collections::HashSet, hash::Hash}; #[cfg(feature = "azalea-buf")] use azalea_buf::{ - BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, + BufReadError, AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, }; #[cfg(feature = "azalea-buf")] use azalea_chat::FormattedText; @@ -81,7 +81,7 @@ impl Suggestions { #[cfg(feature = "azalea-buf")] impl AzaleaRead for Suggestions { fn azalea_read(buf: &mut Cursor<&[u8]>) -> Result { - #[derive(McBuf)] + #[derive(AzBuf)] struct StandaloneSuggestion { pub text: String, pub tooltip: Option, diff --git a/azalea-buf/azalea-buf-macros/Cargo.toml b/azalea-buf/azalea-buf-macros/Cargo.toml index 85545a75..eca13dae 100644 --- a/azalea-buf/azalea-buf-macros/Cargo.toml +++ b/azalea-buf/azalea-buf-macros/Cargo.toml @@ -1,5 +1,5 @@ [package] -description = "#[derive(McBuf)]" +description = "#[derive(AzBuf)]" edition = "2021" license = "MIT" name = "azalea-buf-macros" diff --git a/azalea-buf/azalea-buf-macros/src/lib.rs b/azalea-buf/azalea-buf-macros/src/lib.rs index c5a2238b..9cdbb8af 100755 --- a/azalea-buf/azalea-buf-macros/src/lib.rs +++ b/azalea-buf/azalea-buf-macros/src/lib.rs @@ -19,8 +19,8 @@ pub fn derive_azaleawrite(input: TokenStream) -> TokenStream { write::create_impl_azaleawrite(&ident, &data).into() } -#[proc_macro_derive(McBuf, attributes(var))] -pub fn derive_mcbuf(input: TokenStream) -> TokenStream { +#[proc_macro_derive(AzBuf, attributes(var))] +pub fn derive_azbuf(input: TokenStream) -> TokenStream { let DeriveInput { ident, data, .. } = parse_macro_input!(input); let writable = write::create_impl_azaleawrite(&ident, &data); diff --git a/azalea-buf/azalea-buf-macros/src/read.rs b/azalea-buf/azalea-buf-macros/src/read.rs index 70a6312a..5ab2449a 100644 --- a/azalea-buf/azalea-buf-macros/src/read.rs +++ b/azalea-buf/azalea-buf-macros/src/read.rs @@ -63,7 +63,7 @@ pub fn create_impl_azalearead(ident: &Ident, data: &Data) -> proc_macro2::TokenS } } _ => { - panic!("#[derive(McBuf)] can only be used on structs with named fields") + panic!("#[derive(AzBuf)] can only be used on structs with named fields") } }, syn::Data::Enum(syn::DataEnum { variants, .. }) => { @@ -157,6 +157,6 @@ pub fn create_impl_azalearead(ident: &Ident, data: &Data) -> proc_macro2::TokenS } } } - _ => panic!("#[derive(McBuf)] can only be used on structs"), + _ => panic!("#[derive(AzBuf)] can only be used on structs"), } } diff --git a/azalea-buf/azalea-buf-macros/src/write.rs b/azalea-buf/azalea-buf-macros/src/write.rs index ed98c8a1..df461d59 100644 --- a/azalea-buf/azalea-buf-macros/src/write.rs +++ b/azalea-buf/azalea-buf-macros/src/write.rs @@ -63,7 +63,7 @@ pub fn create_impl_azaleawrite(ident: &Ident, data: &Data) -> proc_macro2::Token } } _ => { - panic!("#[derive(McBuf)] can only be used on structs with named fields") + panic!("#[derive(AzBuf)] can only be used on structs with named fields") } }, syn::Data::Enum(syn::DataEnum { variants, .. }) => { @@ -197,6 +197,6 @@ pub fn create_impl_azaleawrite(ident: &Ident, data: &Data) -> proc_macro2::Token } } } - _ => panic!("#[derive(McBuf)] can only be used on structs"), + _ => panic!("#[derive(AzBuf)] can only be used on structs"), } } diff --git a/azalea-chat/src/style.rs b/azalea-chat/src/style.rs index a27f3d2a..1c900eea 100755 --- a/azalea-chat/src/style.rs +++ b/azalea-chat/src/style.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, fmt}; #[cfg(feature = "azalea-buf")] -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use once_cell::sync::Lazy; use serde::{ser::SerializeStruct, Serialize, Serializer}; use serde_json::Value; @@ -101,7 +101,7 @@ impl Ansi { } #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] -#[cfg_attr(feature = "azalea-buf", derive(McBuf))] +#[cfg_attr(feature = "azalea-buf", derive(AzBuf))] pub enum ChatFormatting { Black, DarkBlue, diff --git a/azalea-client/src/chat.rs b/azalea-client/src/chat.rs index 340c991c..ca748da2 100755 --- a/azalea-client/src/chat.rs +++ b/azalea-client/src/chat.rs @@ -29,7 +29,7 @@ use crate::{ /// A chat packet, either a system message or a chat message. #[derive(Debug, Clone, PartialEq)] -pub enum Chat { +pub enum ChatPacket { System(Arc), Player(Arc), Disguised(Arc), @@ -42,13 +42,13 @@ macro_rules! regex { }}; } -impl Chat { +impl ChatPacket { /// Get the message shown in chat for this packet. pub fn message(&self) -> FormattedText { match self { - Chat::System(p) => p.content.clone(), - Chat::Player(p) => p.message(), - Chat::Disguised(p) => p.message(), + ChatPacket::System(p) => p.content.clone(), + ChatPacket::Player(p) => p.message(), + ChatPacket::Disguised(p) => p.message(), } } @@ -58,7 +58,7 @@ impl Chat { /// None. pub fn split_sender_and_content(&self) -> (Option, String) { match self { - Chat::System(p) => { + ChatPacket::System(p) => { let message = p.content.to_string(); // Overlay messages aren't in chat if p.overlay { @@ -72,13 +72,13 @@ impl Chat { (None, message) } - Chat::Player(p) => ( + ChatPacket::Player(p) => ( // If it's a player chat packet, then the sender and content // are already split for us. Some(p.chat_type.name.to_string()), p.body.content.clone(), ), - Chat::Disguised(p) => ( + ChatPacket::Disguised(p) => ( // disguised chat packets are basically the same as player chat packets but without // the chat signing things Some(p.chat_type.name.to_string()), @@ -99,9 +99,9 @@ impl Chat { /// when a server uses a plugin to modify chat messages). pub fn uuid(&self) -> Option { match self { - Chat::System(_) => None, - Chat::Player(m) => Some(m.sender), - Chat::Disguised(_) => None, + ChatPacket::System(_) => None, + ChatPacket::Player(m) => Some(m.sender), + ChatPacket::Disguised(_) => None, } } @@ -115,7 +115,7 @@ impl Chat { /// Create a new Chat from a string. This is meant to be used as a /// convenience function for testing. pub fn new(message: &str) -> Self { - Chat::System(Arc::new(ClientboundSystemChat { + ChatPacket::System(Arc::new(ClientboundSystemChat { content: FormattedText::from(message), overlay: false, })) @@ -197,7 +197,7 @@ impl Plugin for ChatPlugin { #[derive(Event, Debug, Clone)] pub struct ChatReceivedEvent { pub entity: Entity, - pub packet: Chat, + pub packet: ChatPacket, } /// Send a chat message (or command, if it starts with a slash) to the server. diff --git a/azalea-client/src/events.rs b/azalea-client/src/events.rs index 29ff7637..fb8afa75 100644 --- a/azalea-client/src/events.rs +++ b/azalea-client/src/events.rs @@ -21,7 +21,7 @@ use derive_more::{Deref, DerefMut}; use tokio::sync::mpsc; use crate::{ - chat::{Chat, ChatReceivedEvent}, + chat::{ChatPacket, ChatReceivedEvent}, disconnect::DisconnectEvent, packet_handling::game::{ AddPlayerEvent, DeathEvent, KeepAliveEvent, PacketEvent, RemovePlayerEvent, @@ -62,7 +62,7 @@ pub enum Event { /// The client is now in the world. Fired when we receive a login packet. Login, /// A chat message was sent in the game chat. - Chat(Chat), + Chat(ChatPacket), /// Happens 20 times per second, but only when the world is loaded. Tick, /// We received a packet from the server. diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index e71938e5..025fb9b5 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -33,7 +33,7 @@ use tracing::{debug, error, trace, warn}; use uuid::Uuid; use crate::{ - chat::{Chat, ChatReceivedEvent}, + chat::{ChatPacket, ChatReceivedEvent}, chunks, disconnect::DisconnectEvent, inventory::{ @@ -1030,7 +1030,7 @@ pub fn process_packet_events(ecs: &mut World) { chat_events.send(ChatReceivedEvent { entity: player_entity, - packet: Chat::Player(Arc::new(p.clone())), + packet: ChatPacket::Player(Arc::new(p.clone())), }); } ClientboundGamePacket::SystemChat(p) => { @@ -1042,7 +1042,7 @@ pub fn process_packet_events(ecs: &mut World) { chat_events.send(ChatReceivedEvent { entity: player_entity, - packet: Chat::System(Arc::new(p.clone())), + packet: ChatPacket::System(Arc::new(p.clone())), }); } ClientboundGamePacket::DisguisedChat(p) => { @@ -1054,7 +1054,7 @@ pub fn process_packet_events(ecs: &mut World) { chat_events.send(ChatReceivedEvent { entity: player_entity, - packet: Chat::Disguised(Arc::new(p.clone())), + packet: ChatPacket::Disguised(Arc::new(p.clone())), }); } ClientboundGamePacket::Sound(_p) => { diff --git a/azalea-core/src/bitset.rs b/azalea-core/src/bitset.rs index c6756b55..c7e039de 100755 --- a/azalea-core/src/bitset.rs +++ b/azalea-core/src/bitset.rs @@ -1,9 +1,9 @@ use std::io::{Cursor, Write}; -use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite}; +use azalea_buf::{BufReadError, AzBuf, AzaleaRead, AzaleaWrite}; /// Represents Java's BitSet, a list of bits. -#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, McBuf)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Default, AzBuf)] pub struct BitSet { data: Vec, } diff --git a/azalea-core/src/delta.rs b/azalea-core/src/delta.rs index 2dd67005..cf46471b 100755 --- a/azalea-core/src/delta.rs +++ b/azalea-core/src/delta.rs @@ -1,4 +1,4 @@ -pub use azalea_buf::McBuf; +pub use azalea_buf::AzBuf; use crate::position::Vec3; @@ -9,7 +9,7 @@ pub trait PositionDeltaTrait { } /// Only works for up to 8 blocks -#[derive(Clone, Debug, McBuf, Default)] +#[derive(Clone, Debug, AzBuf, Default)] pub struct PositionDelta8 { pub xa: i16, pub ya: i16, diff --git a/azalea-core/src/direction.rs b/azalea-core/src/direction.rs index 32e1a23a..b0b8c960 100755 --- a/azalea-core/src/direction.rs +++ b/azalea-core/src/direction.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use crate::position::Vec3; -#[derive(Clone, Copy, Debug, McBuf, Default, Eq, PartialEq)] +#[derive(Clone, Copy, Debug, AzBuf, Default, Eq, PartialEq)] pub enum Direction { #[default] Down = 0, @@ -62,7 +62,7 @@ impl Direction { } // TODO: make azalea_block use this instead of FacingCardinal -#[derive(Clone, Copy, Debug, McBuf, PartialEq, Eq, Hash)] +#[derive(Clone, Copy, Debug, AzBuf, PartialEq, Eq, Hash)] pub enum CardinalDirection { North, South, diff --git a/azalea-core/src/objectives.rs b/azalea-core/src/objectives.rs index dd1534f2..a2f0d517 100644 --- a/azalea-core/src/objectives.rs +++ b/azalea-core/src/objectives.rs @@ -3,9 +3,9 @@ use std::{ str::FromStr, }; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; -#[derive(Clone, Copy, Debug, McBuf)] +#[derive(Clone, Copy, Debug, AzBuf)] pub enum ObjectiveCriteria { Integer, Hearts, diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index c9aa010a..22cb490a 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -11,7 +11,7 @@ use std::{ str::FromStr, }; -use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite}; +use azalea_buf::{BufReadError, AzBuf, AzaleaRead, AzaleaWrite}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; @@ -214,7 +214,7 @@ macro_rules! vec3_impl { /// Used to represent an exact position in the world where an entity could be. /// For blocks, [`BlockPos`] is used instead. -#[derive(Clone, Copy, Debug, Default, PartialEq, McBuf)] +#[derive(Clone, Copy, Debug, Default, PartialEq, AzBuf)] #[cfg_attr(feature = "serde", derive(Deserialize, Serialize))] pub struct Vec3 { pub x: f64, diff --git a/azalea-core/src/resource_location.rs b/azalea-core/src/resource_location.rs index 539b9b81..c95e3109 100755 --- a/azalea-core/src/resource_location.rs +++ b/azalea-core/src/resource_location.rs @@ -6,7 +6,7 @@ use std::{ str::FromStr, }; -use azalea_buf::{BufReadError, AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzaleaRead, AzaleaWrite, BufReadError}; #[cfg(feature = "serde")] use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use simdnbt::{owned::NbtTag, FromNbtTag, ToNbtTag}; @@ -142,7 +142,7 @@ mod tests { } #[test] - fn mcbuf_resource_location() { + fn azbuf_resource_location() { let mut buf = Vec::new(); ResourceLocation::new("minecraft:dirt") .azalea_write(&mut buf) diff --git a/azalea-crypto/src/signing.rs b/azalea-crypto/src/signing.rs index 9e276ede..ba9cc305 100755 --- a/azalea-crypto/src/signing.rs +++ b/azalea-crypto/src/signing.rs @@ -1,6 +1,6 @@ use std::time::{SystemTime, UNIX_EPOCH}; -use azalea_buf::{McBuf, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaWrite}; use rsa::{ signature::{RandomizedSigner, SignatureEncoding}, RsaPrivateKey, @@ -8,18 +8,18 @@ use rsa::{ use sha2::Sha256; use uuid::Uuid; -#[derive(Debug, Clone, McBuf)] +#[derive(Debug, Clone, AzBuf)] pub struct SaltSignaturePair { pub salt: u64, pub signature: Vec, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct MessageSignature { pub bytes: [u8; 256], } -#[derive(Clone, Debug, McBuf, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct SignedMessageHeader { pub previous_signature: Option, pub sender: Uuid, diff --git a/azalea-entity/src/attributes.rs b/azalea-entity/src/attributes.rs index ddafaec3..797ea43c 100644 --- a/azalea-entity/src/attributes.rs +++ b/azalea-entity/src/attributes.rs @@ -2,7 +2,7 @@ use std::collections::{hash_map, HashMap}; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use bevy_ecs::component::Component; use thiserror::Error; @@ -71,14 +71,14 @@ impl AttributeInstance { } } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct AttributeModifier { pub id: ResourceLocation, pub amount: f64, pub operation: AttributeModifierOperation, } -#[derive(Clone, Debug, Copy, McBuf)] +#[derive(Clone, Debug, Copy, AzBuf)] pub enum AttributeModifierOperation { Addition, MultiplyBase, diff --git a/azalea-entity/src/data.rs b/azalea-entity/src/data.rs index a67037e2..257c41c3 100755 --- a/azalea-entity/src/data.rs +++ b/azalea-entity/src/data.rs @@ -2,7 +2,7 @@ use std::io::{Cursor, Write}; -use azalea_buf::{AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError, McBuf}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_chat::FormattedText; use azalea_core::{ direction::Direction, @@ -62,7 +62,7 @@ impl AzaleaWrite for EntityMetadataItems { // Note: This enum is partially generated and parsed by // codegen/lib/code/entity.py -#[derive(Clone, Debug, EnumAsInner, McBuf)] +#[derive(Clone, Debug, EnumAsInner, AzBuf)] pub enum EntityDataValue { Byte(u8), Int(#[var] i32), @@ -102,7 +102,7 @@ pub enum EntityDataValue { #[derive(Clone, Debug)] pub struct OptionalUnsignedInt(pub Option); -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct Quaternion { pub x: f32, pub y: f32, @@ -112,7 +112,7 @@ pub struct Quaternion { // mojang just calls this ArmadilloState but i added "Kind" since otherwise it // collides with a name in metadata.rs -#[derive(Clone, Debug, Copy, Default, McBuf)] +#[derive(Clone, Debug, Copy, Default, AzBuf)] pub enum ArmadilloStateKind { #[default] Idle, @@ -140,14 +140,14 @@ impl AzaleaWrite for OptionalUnsignedInt { } /// A set of x, y, and z rotations. This is used for armor stands. -#[derive(Clone, Debug, McBuf, Default)] +#[derive(Clone, Debug, AzBuf, Default)] pub struct Rotations { pub x: f32, pub y: f32, pub z: f32, } -#[derive(Clone, Debug, Copy, McBuf, Default, Component, Eq, PartialEq)] +#[derive(Clone, Debug, Copy, AzBuf, Default, Component, Eq, PartialEq)] pub enum Pose { #[default] Standing = 0, @@ -160,7 +160,7 @@ pub enum Pose { Dying, } -#[derive(Debug, Clone, McBuf)] +#[derive(Debug, Clone, AzBuf)] pub struct VillagerData { pub kind: azalea_registry::VillagerKind, pub profession: azalea_registry::VillagerProfession, @@ -197,7 +197,7 @@ impl TryFrom for Vec { } } -#[derive(Debug, Copy, Clone, McBuf, Default)] +#[derive(Debug, Copy, Clone, AzBuf, Default)] pub enum SnifferState { #[default] Idling, diff --git a/azalea-entity/src/particle.rs b/azalea-entity/src/particle.rs index 202f6f1d..76559e58 100755 --- a/azalea-entity/src/particle.rs +++ b/azalea-entity/src/particle.rs @@ -1,4 +1,4 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_inventory::ItemStack; use azalea_registry::ParticleKind; @@ -7,7 +7,7 @@ use bevy_ecs::component::Component; // the order of this enum must be kept in sync with ParticleKind, otherwise // we get errors parsing particles. /// A [`ParticleKind`] with data potentially attached to it. -#[derive(Component, Clone, Debug, McBuf, Default)] +#[derive(Component, Clone, Debug, AzBuf, Default)] pub enum Particle { AngryVillager, Block(BlockParticle), @@ -249,12 +249,12 @@ impl From for Particle { } } -#[derive(Debug, Clone, McBuf, Default)] +#[derive(Debug, Clone, AzBuf, Default)] pub struct BlockParticle { #[var] pub block_state: i32, } -#[derive(Debug, Clone, McBuf, Default)] +#[derive(Debug, Clone, AzBuf, Default)] pub struct DustParticle { /// Red value, 0-1 pub red: f32, @@ -266,7 +266,7 @@ pub struct DustParticle { pub scale: f32, } -#[derive(Debug, Clone, McBuf, Default)] +#[derive(Debug, Clone, AzBuf, Default)] pub struct DustColorTransitionParticle { /// Red value, 0-1 pub from_red: f32, @@ -284,12 +284,12 @@ pub struct DustColorTransitionParticle { pub to_blue: f32, } -#[derive(Debug, Clone, McBuf, Default)] +#[derive(Debug, Clone, AzBuf, Default)] pub struct ItemParticle { pub item: ItemStack, } -#[derive(Debug, Clone, McBuf, Default)] +#[derive(Debug, Clone, AzBuf, Default)] pub struct VibrationParticle { pub origin: BlockPos, pub position_type: String, @@ -300,12 +300,12 @@ pub struct VibrationParticle { pub ticks: u32, } -#[derive(Debug, Clone, McBuf, Default)] +#[derive(Debug, Clone, AzBuf, Default)] pub struct SculkChargeParticle { pub roll: f32, } -#[derive(Debug, Clone, McBuf, Default)] +#[derive(Debug, Clone, AzBuf, Default)] pub struct ShriekParticle { #[var] pub delay: i32, // The time in ticks before the particle is displayed diff --git a/azalea-inventory/src/components.rs b/azalea-inventory/src/components.rs index f2d44a05..10b00b36 100644 --- a/azalea-inventory/src/components.rs +++ b/azalea-inventory/src/components.rs @@ -1,7 +1,7 @@ use core::f64; use std::{any::Any, collections::HashMap, io::Cursor}; -use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; use azalea_chat::FormattedText; use azalea_core::{position::GlobalPos, resource_location::ResourceLocation}; use azalea_registry::{ @@ -134,27 +134,27 @@ pub fn from_kind( }) } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct CustomData { pub nbt: Nbt, } impl DataComponent for CustomData {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct MaxStackSize { #[var] pub count: i32, } impl DataComponent for MaxStackSize {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct MaxDamage { #[var] pub amount: i32, } impl DataComponent for MaxDamage {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Damage { #[var] pub amount: i32, @@ -162,7 +162,7 @@ pub struct Damage { impl DataComponent for Damage {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Unbreakable { pub show_in_tooltip: bool, } @@ -175,26 +175,26 @@ impl Default for Unbreakable { } } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct CustomName { pub name: FormattedText, } impl DataComponent for CustomName {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct ItemName { pub name: FormattedText, } impl DataComponent for ItemName {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Lore { pub lines: Vec, // vanilla also has styled_lines here but it doesn't appear to be used for the protocol } impl DataComponent for Lore {} -#[derive(Clone, PartialEq, Copy, McBuf)] +#[derive(Clone, PartialEq, Copy, AzBuf)] pub enum Rarity { Common, Uncommon, @@ -203,7 +203,7 @@ pub enum Rarity { } impl DataComponent for Rarity {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Enchantments { #[var] pub levels: HashMap, @@ -211,7 +211,7 @@ pub struct Enchantments { } impl DataComponent for Enchantments {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub enum BlockStateValueMatcher { Exact { value: String, @@ -222,38 +222,38 @@ pub enum BlockStateValueMatcher { }, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BlockStatePropertyMatcher { pub name: String, pub value_matcher: BlockStateValueMatcher, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BlockPredicate { pub blocks: Option>, pub properties: Option>, pub nbt: Option, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct AdventureModePredicate { pub predicates: Vec, pub show_in_tooltip: bool, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct CanPlaceOn { pub predicate: AdventureModePredicate, } impl DataComponent for CanPlaceOn {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct CanBreak { pub predicate: AdventureModePredicate, } impl DataComponent for CanBreak {} -#[derive(Clone, Copy, PartialEq, McBuf)] +#[derive(Clone, Copy, PartialEq, AzBuf)] pub enum EquipmentSlotGroup { Any, Mainhand, @@ -267,7 +267,7 @@ pub enum EquipmentSlotGroup { Body, } -#[derive(Clone, Copy, PartialEq, McBuf)] +#[derive(Clone, Copy, PartialEq, AzBuf)] pub enum AttributeModifierOperation { Addition, MultiplyBase, @@ -277,7 +277,7 @@ pub enum AttributeModifierOperation { // this is duplicated in azalea-entity, BUT the one there has a different // protocol format (and we can't use it anyways because it would cause a // circular dependency) -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct AttributeModifier { pub uuid: Uuid, pub name: String, @@ -285,57 +285,57 @@ pub struct AttributeModifier { pub operation: AttributeModifierOperation, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct AttributeModifiersEntry { pub attribute: Attribute, pub modifier: AttributeModifier, pub slot: EquipmentSlotGroup, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct AttributeModifiers { pub modifiers: Vec, pub show_in_tooltip: bool, } impl DataComponent for AttributeModifiers {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct CustomModelData { #[var] pub value: i32, } impl DataComponent for CustomModelData {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct HideAdditionalTooltip; impl DataComponent for HideAdditionalTooltip {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct HideTooltip; impl DataComponent for HideTooltip {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct RepairCost { #[var] pub cost: u32, } impl DataComponent for RepairCost {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct CreativeSlotLock; impl DataComponent for CreativeSlotLock {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct EnchantmentGlintOverride { pub show_glint: bool, } impl DataComponent for EnchantmentGlintOverride {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct IntangibleProjectile; impl DataComponent for IntangibleProjectile {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct MobEffectDetails { #[var] pub amplifier: i32, @@ -347,19 +347,19 @@ pub struct MobEffectDetails { pub hidden_effect: Option>, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct MobEffectInstance { pub effect: MobEffect, pub details: MobEffectDetails, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct PossibleEffect { pub effect: MobEffectInstance, pub probability: f32, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Food { #[var] pub nutrition: i32, @@ -370,14 +370,14 @@ pub struct Food { } impl DataComponent for Food {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct ToolRule { pub blocks: HolderSet, pub speed: Option, pub correct_for_drops: Option, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Tool { pub rules: Vec, pub default_mining_speed: f32, @@ -386,7 +386,7 @@ pub struct Tool { } impl DataComponent for Tool {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct StoredEnchantments { #[var] pub enchantments: HashMap, @@ -394,52 +394,52 @@ pub struct StoredEnchantments { } impl DataComponent for StoredEnchantments {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct DyedColor { pub rgb: i32, pub show_in_tooltip: bool, } impl DataComponent for DyedColor {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct MapColor { pub color: i32, } impl DataComponent for MapColor {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct MapId { #[var] pub id: i32, } impl DataComponent for MapId {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct MapDecorations { pub decorations: NbtCompound, } impl DataComponent for MapDecorations {} -#[derive(Clone, Copy, PartialEq, McBuf)] +#[derive(Clone, Copy, PartialEq, AzBuf)] pub enum MapPostProcessing { Lock, Scale, } impl DataComponent for MapPostProcessing {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct ChargedProjectiles { pub items: Vec, } impl DataComponent for ChargedProjectiles {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BundleContents { pub items: Vec, } impl DataComponent for BundleContents {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct PotionContents { pub potion: Option, pub custom_color: Option, @@ -447,26 +447,26 @@ pub struct PotionContents { } impl DataComponent for PotionContents {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct SuspiciousStewEffect { pub effect: MobEffect, #[var] pub duration: i32, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct SuspiciousStewEffects { pub effects: Vec, } impl DataComponent for SuspiciousStewEffects {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct WritableBookContent { pub pages: Vec, } impl DataComponent for WritableBookContent {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct WrittenBookContent { pub title: String, pub author: String, @@ -477,7 +477,7 @@ pub struct WrittenBookContent { } impl DataComponent for WrittenBookContent {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Trim { pub material: TrimMaterial, pub pattern: TrimPattern, @@ -485,57 +485,57 @@ pub struct Trim { } impl DataComponent for Trim {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct DebugStickState { pub properties: NbtCompound, } impl DataComponent for DebugStickState {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct EntityData { pub entity: NbtCompound, } impl DataComponent for EntityData {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BucketEntityData { pub entity: NbtCompound, } impl DataComponent for BucketEntityData {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BlockEntityData { pub entity: NbtCompound, } impl DataComponent for BlockEntityData {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Instrument { pub instrument: azalea_registry::Instrument, } impl DataComponent for Instrument {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct OminousBottleAmplifier { #[var] pub amplifier: i32, } impl DataComponent for OminousBottleAmplifier {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Recipes { pub recipes: Vec, } impl DataComponent for Recipes {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct LodestoneTracker { pub target: Option, pub tracked: bool, } impl DataComponent for LodestoneTracker {} -#[derive(Clone, Copy, PartialEq, McBuf)] +#[derive(Clone, Copy, PartialEq, AzBuf)] pub enum FireworkExplosionShape { SmallBall, LargeBall, @@ -544,7 +544,7 @@ pub enum FireworkExplosionShape { Burst, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct FireworkExplosion { pub shape: FireworkExplosionShape, pub colors: Vec, @@ -554,7 +554,7 @@ pub struct FireworkExplosion { } impl DataComponent for FireworkExplosion {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Fireworks { #[var] pub flight_duration: i32, @@ -562,14 +562,14 @@ pub struct Fireworks { } impl DataComponent for Fireworks {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct GameProfileProperty { pub name: String, pub value: String, pub signature: Option, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Profile { pub name: String, pub id: Option, @@ -577,13 +577,13 @@ pub struct Profile { } impl DataComponent for Profile {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct NoteBlockSound { pub sound: ResourceLocation, } impl DataComponent for NoteBlockSound {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BannerPattern { #[var] pub pattern: i32, @@ -591,13 +591,13 @@ pub struct BannerPattern { pub color: i32, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BannerPatterns { pub patterns: Vec, } impl DataComponent for BannerPatterns {} -#[derive(Clone, Copy, PartialEq, McBuf)] +#[derive(Clone, Copy, PartialEq, AzBuf)] pub enum DyeColor { White, Orange, @@ -617,31 +617,31 @@ pub enum DyeColor { Black, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BaseColor { pub color: DyeColor, } impl DataComponent for BaseColor {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct PotDecorations { pub items: Vec, } impl DataComponent for PotDecorations {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Container { pub items: Vec, } impl DataComponent for Container {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BlockState { pub properties: HashMap, } impl DataComponent for BlockState {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct BeehiveOccupant { pub entity_data: NbtCompound, #[var] @@ -650,32 +650,32 @@ pub struct BeehiveOccupant { pub min_ticks_in_hive: i32, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Bees { pub occupants: Vec, } impl DataComponent for Bees {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Lock { pub key: String, } impl DataComponent for Lock {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct ContainerLoot { pub loot: NbtCompound, } impl DataComponent for ContainerLoot {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct JukeboxPlayable { pub song: azalea_registry::JukeboxSong, pub show_in_tooltip: bool, } impl DataComponent for JukeboxPlayable {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Consumable { pub consume_seconds: f32, pub animation: ItemUseAnimation, @@ -685,7 +685,7 @@ pub struct Consumable { } impl DataComponent for Consumable {} -#[derive(Clone, Copy, PartialEq, McBuf)] +#[derive(Clone, Copy, PartialEq, AzBuf)] pub enum ItemUseAnimation { None, Eat, @@ -699,39 +699,39 @@ pub enum ItemUseAnimation { Brush, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct UseRemainder { pub convert_into: ItemStack, } impl DataComponent for UseRemainder {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct UseCooldown { pub seconds: f32, pub cooldown_group: Option, } impl DataComponent for UseCooldown {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Enchantable { #[var] pub value: u32, } impl DataComponent for Enchantable {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Repairable { pub items: HolderSet, } impl DataComponent for Repairable {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct ItemModel { pub resource_location: ResourceLocation, } impl DataComponent for ItemModel {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct DamageResistant { // in the vanilla code this is // ``` @@ -745,7 +745,7 @@ pub struct DamageResistant { } impl DataComponent for DamageResistant {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Equippable { pub slot: EquipmentSlot, pub equip_sound: SoundEvent, @@ -754,7 +754,7 @@ pub struct Equippable { } impl DataComponent for Equippable {} -#[derive(Clone, Copy, Debug, PartialEq, McBuf)] +#[derive(Clone, Copy, Debug, PartialEq, AzBuf)] pub enum EquipmentSlot { Mainhand, Offhand, @@ -767,17 +767,17 @@ pub enum EquipmentSlot { Body, } -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct Glider; impl DataComponent for Glider {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct TooltipStyle { pub resource_location: ResourceLocation, } impl DataComponent for TooltipStyle {} -#[derive(Clone, PartialEq, McBuf)] +#[derive(Clone, PartialEq, AzBuf)] pub struct DeathProtection { pub death_effects: Vec, } diff --git a/azalea-inventory/src/operations.rs b/azalea-inventory/src/operations.rs index 0f73d877..0df7c794 100644 --- a/azalea-inventory/src/operations.rs +++ b/azalea-inventory/src/operations.rs @@ -1,6 +1,6 @@ use std::ops::RangeInclusive; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use crate::{ item::MaxStackSizeExt, AnvilMenuLocation, BeaconMenuLocation, BlastFurnaceMenuLocation, @@ -250,7 +250,7 @@ impl ClickOperation { } } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum ClickType { Pickup = 0, QuickMove = 1, diff --git a/azalea-protocol/README.md b/azalea-protocol/README.md index 91d425a6..e1923c9e 100755 --- a/azalea-protocol/README.md +++ b/azalea-protocol/README.md @@ -21,6 +21,6 @@ Adding new packets is usually pretty easy, but you'll want to have Minecraft's d ### Implementing packets -You can manually implement reading and writing functionality for a packet by implementing AzaleaRead and AzaleaWrite, but you can also have this automatically generated for a struct or enum by deriving McBuf. +You can manually implement reading and writing functionality for a packet by implementing AzaleaRead and AzaleaWrite, but you can also have this automatically generated for a struct or enum by deriving AzBuf. Look at other packets as an example. diff --git a/azalea-protocol/src/common.rs b/azalea-protocol/src/common.rs index 9529cd1b..d5b5bf1b 100644 --- a/azalea-protocol/src/common.rs +++ b/azalea-protocol/src/common.rs @@ -1,13 +1,13 @@ //! Some serializable data types that are used by several packets. -use azalea_buf::{AzaleaRead, AzaleaWrite, McBuf}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; use azalea_core::bitset::FixedBitSet; use bevy_ecs::component::Component; /// A component that contains some of the "settings" for this client that are /// sent to the server, such as render distance. This is only present on local /// players. -#[derive(Clone, Debug, McBuf, PartialEq, Eq, Component)] +#[derive(Clone, Debug, AzBuf, PartialEq, Eq, Component)] pub struct ClientInformation { /// The locale of the client. pub language: String, @@ -45,7 +45,7 @@ impl Default for ClientInformation { } } -#[derive(McBuf, Clone, Copy, Debug, PartialEq, Eq, Default)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq, Default)] pub enum ChatVisibility { /// All chat messages should be sent to the client. #[default] @@ -57,7 +57,7 @@ pub enum ChatVisibility { Hidden = 2, } -#[derive(McBuf, Clone, Copy, Debug, PartialEq, Eq, Default)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq, Default)] pub enum HumanoidArm { Left = 0, #[default] @@ -75,7 +75,7 @@ pub struct ModelCustomization { pub hat: bool, } -#[derive(McBuf, Clone, Copy, Debug, PartialEq, Eq, Default)] +#[derive(AzBuf, Clone, Copy, Debug, PartialEq, Eq, Default)] pub enum ParticleStatus { #[default] All, diff --git a/azalea-protocol/src/packets/common.rs b/azalea-protocol/src/packets/common.rs index 173e15fc..fc78cd7a 100644 --- a/azalea-protocol/src/packets/common.rs +++ b/azalea-protocol/src/packets/common.rs @@ -1,11 +1,11 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::{ game_type::{GameMode, OptionalGameType}, position::GlobalPos, resource_location::ResourceLocation, }; -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct CommonPlayerSpawnInfo { pub dimension_type: azalea_registry::DimensionType, pub dimension: ResourceLocation, diff --git a/azalea-protocol/src/packets/config/c_cookie_request.rs b/azalea-protocol/src/packets/config/c_cookie_request.rs index d9f0a426..4c57718d 100644 --- a/azalea-protocol/src/packets/config/c_cookie_request.rs +++ b/azalea-protocol/src/packets/config/c_cookie_request.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 c00f22c6..3432ac3a 100644 --- a/azalea-protocol/src/packets/config/c_custom_payload.rs +++ b/azalea-protocol/src/packets/config/c_custom_payload.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_buf::UnsizedByteArray; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundCustomPayload { pub identifier: ResourceLocation, pub data: UnsizedByteArray, diff --git a/azalea-protocol/src/packets/config/c_disconnect.rs b/azalea-protocol/src/packets/config/c_disconnect.rs index 3dec97f2..b59b318d 100644 --- a/azalea-protocol/src/packets/config/c_disconnect.rs +++ b/azalea-protocol/src/packets/config/c_disconnect.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 1c904bfc..e3f3e5a5 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 93ea610f..f0310c34 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 29067db3..35b5c39c 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 14ae09fb..185de4c3 100644 --- a/azalea-protocol/src/packets/config/c_registry_data.rs +++ b/azalea-protocol/src/packets/config/c_registry_data.rs @@ -1,11 +1,11 @@ use std::collections::HashMap; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; use simdnbt::owned::NbtCompound; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundRegistryData { pub registry_id: ResourceLocation, pub entries: HashMap>, diff --git a/azalea-protocol/src/packets/config/c_reset_chat.rs b/azalea-protocol/src/packets/config/c_reset_chat.rs index 7525d925..273cb0fd 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 index 50b2fb32..63a59b5b 100644 --- a/azalea-protocol/src/packets/config/c_resource_pack.rs +++ b/azalea-protocol/src/packets/config/c_resource_pack.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundResourcePack { pub url: String, pub hash: String, 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 042ba8ff..f949a726 100644 --- a/azalea-protocol/src/packets/config/c_resource_pack_pop.rs +++ b/azalea-protocol/src/packets/config/c_resource_pack_pop.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundResourcePackPop { pub id: Option, } 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 677f8cef..6be5c709 100644 --- a/azalea-protocol/src/packets/config/c_resource_pack_push.rs +++ b/azalea-protocol/src/packets/config/c_resource_pack_push.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundConfigPacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 ac17fea3..6a4f76db 100644 --- a/azalea-protocol/src/packets/config/c_select_known_packs.rs +++ b/azalea-protocol/src/packets/config/c_select_known_packs.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; use super::s_select_known_packs::KnownPack; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundSelectKnownPacks { pub known_packs: Vec, } diff --git a/azalea-protocol/src/packets/config/c_store_cookie.rs b/azalea-protocol/src/packets/config/c_store_cookie.rs index 01f8bf89..c52211ea 100644 --- a/azalea-protocol/src/packets/config/c_store_cookie.rs +++ b/azalea-protocol/src/packets/config/c_store_cookie.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundStoreCookie { pub key: ResourceLocation, pub payload: Vec, diff --git a/azalea-protocol/src/packets/config/c_transfer.rs b/azalea-protocol/src/packets/config/c_transfer.rs index 3d92d5cd..332421d8 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 4b0748f9..4529c757 100644 --- a/azalea-protocol/src/packets/config/c_update_enabled_features.rs +++ b/azalea-protocol/src/packets/config/c_update_enabled_features.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundUpdateEnabledFeatures { pub features: Vec, } diff --git a/azalea-protocol/src/packets/config/c_update_tags.rs b/azalea-protocol/src/packets/config/c_update_tags.rs index 95b75d2c..678a5ccf 100644 --- a/azalea-protocol/src/packets/config/c_update_tags.rs +++ b/azalea-protocol/src/packets/config/c_update_tags.rs @@ -2,12 +2,12 @@ use std::io::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_buf::{AzaleaWriteVar, BufReadError, McBuf, AzaleaReadVar}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigPacket; -#[derive(Clone, Debug, McBuf, ClientboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundConfigPacket)] pub struct ClientboundUpdateTags { pub tags: TagMap, } diff --git a/azalea-protocol/src/packets/config/s_client_information.rs b/azalea-protocol/src/packets/config/s_client_information.rs index efde4055..614890ff 100644 --- a/azalea-protocol/src/packets/config/s_client_information.rs +++ b/azalea-protocol/src/packets/config/s_client_information.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; use crate::common::ClientInformation; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket, PartialEq, Eq)] +#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket, PartialEq, Eq)] 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 8cde60fa..e932352f 100644 --- a/azalea-protocol/src/packets/config/s_cookie_response.rs +++ b/azalea-protocol/src/packets/config/s_cookie_response.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] pub struct ServerboundCookieResponse { pub key: ResourceLocation, pub payload: Option>, diff --git a/azalea-protocol/src/packets/config/s_custom_payload.rs b/azalea-protocol/src/packets/config/s_custom_payload.rs index b331e5dd..f480985d 100644 --- a/azalea-protocol/src/packets/config/s_custom_payload.rs +++ b/azalea-protocol/src/packets/config/s_custom_payload.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_buf::UnsizedByteArray; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 268f945f..a4d94fb1 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 a916deef..1986a4eb 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 c2d041da..50c012dd 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, 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 503606aa..0822c723 100644 --- a/azalea-protocol/src/packets/config/s_resource_pack.rs +++ b/azalea-protocol/src/packets/config/s_resource_pack.rs @@ -1,14 +1,14 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] pub struct ServerboundResourcePack { pub id: Uuid, pub action: Action, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 5d3668d9..320b5ca5 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundConfigPacket; -#[derive(Clone, Debug, McBuf, ServerboundConfigPacket)] +#[derive(Clone, Debug, AzBuf, ServerboundConfigPacket)] pub struct ServerboundSelectKnownPacks { pub known_packs: Vec, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] 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 6ff5c976..cf0adeb7 100755 --- a/azalea-protocol/src/packets/game/c_add_entity.rs +++ b/azalea-protocol/src/packets/game/c_add_entity.rs @@ -1,10 +1,10 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::{position::Vec3, resource_location::ResourceLocation}; use azalea_entity::{metadata::apply_default_metadata, EntityBundle}; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundAddEntity { /// The id of the entity. #[var] diff --git a/azalea-protocol/src/packets/game/c_add_experience_orb.rs b/azalea-protocol/src/packets/game/c_add_experience_orb.rs index 93d28cd0..b3d12858 100755 --- a/azalea-protocol/src/packets/game/c_add_experience_orb.rs +++ b/azalea-protocol/src/packets/game/c_add_experience_orb.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundAddExperienceOrb { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_add_player.rs b/azalea-protocol/src/packets/game/c_add_player.rs index 68bc033a..7b36567d 100755 --- a/azalea-protocol/src/packets/game/c_add_player.rs +++ b/azalea-protocol/src/packets/game/c_add_player.rs @@ -1,4 +1,4 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::{ResourceLocation, Vec3}; use azalea_entity::{metadata::PlayerMetadataBundle, EntityBundle, PlayerBundle}; use azalea_protocol_macros::ClientboundGamePacket; @@ -7,7 +7,7 @@ use uuid::Uuid; /// This packet is sent by the server when a player comes into visible range, /// not when a player joins. -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundAddPlayer { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_animate.rs b/azalea-protocol/src/packets/game/c_animate.rs index 0c89aafa..bda0b152 100755 --- a/azalea-protocol/src/packets/game/c_animate.rs +++ b/azalea-protocol/src/packets/game/c_animate.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundAnimate { #[var] pub id: u32, @@ -10,7 +10,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, McBuf)] +#[derive(Clone, Debug, Copy, AzBuf)] 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 2239ed9f..20f8b1e0 100755 --- a/azalea-protocol/src/packets/game/c_award_stats.rs +++ b/azalea-protocol/src/packets/game/c_award_stats.rs @@ -1,15 +1,15 @@ use std::collections::HashMap; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundAwardStats { #[var] pub stats: HashMap, } -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, McBuf)] +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, AzBuf)] pub enum Stat { Mined(azalea_registry::Block), Crafted(azalea_registry::Item), 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 98788580..ebb303c0 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundBlockChangedAck { #[var] pub sequence: i32, diff --git a/azalea-protocol/src/packets/game/c_block_destruction.rs b/azalea-protocol/src/packets/game/c_block_destruction.rs index e702790e..50d8085b 100755 --- a/azalea-protocol/src/packets/game/c_block_destruction.rs +++ b/azalea-protocol/src/packets/game/c_block_destruction.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 425ac266..82ba60de 100755 --- a/azalea-protocol/src/packets/game/c_block_entity_data.rs +++ b/azalea-protocol/src/packets/game/c_block_entity_data.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; use simdnbt::owned::Nbt; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 c98661ef..3a71b186 100755 --- a/azalea-protocol/src/packets/game/c_block_event.rs +++ b/azalea-protocol/src/packets/game/c_block_event.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::Block; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 369b8cc5..ae9bd998 100755 --- a/azalea-protocol/src/packets/game/c_block_update.rs +++ b/azalea-protocol/src/packets/game/c_block_update.rs @@ -1,9 +1,9 @@ use azalea_block::BlockState; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 5e479db2..e54ab59f 100755 --- a/azalea-protocol/src/packets/game/c_boss_event.rs +++ b/azalea-protocol/src/packets/game/c_boss_event.rs @@ -1,15 +1,13 @@ use std::io::Cursor; use std::io::Write; -use azalea_buf::{ - BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, -}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_chat::FormattedText; use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundBossEvent { pub id: Uuid, pub operation: Operation, @@ -75,7 +73,7 @@ impl AzaleaWrite for Operation { } } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct AddOperation { pub name: FormattedText, pub progress: f32, @@ -83,13 +81,13 @@ pub struct AddOperation { pub properties: Properties, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct Style { pub color: BossBarColor, pub overlay: BossBarOverlay, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum BossBarColor { Pink = 0, Blue = 1, @@ -100,7 +98,7 @@ pub enum BossBarColor { White = 6, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum BossBarOverlay { Progress = 0, Notched6 = 1, diff --git a/azalea-protocol/src/packets/game/c_bundle.rs b/azalea-protocol/src/packets/game/c_bundle.rs index 1e553ce4..f9379b97 100644 --- a/azalea-protocol/src/packets/game/c_bundle.rs +++ b/azalea-protocol/src/packets/game/c_bundle.rs @@ -1,5 +1,5 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundBundle {} diff --git a/azalea-protocol/src/packets/game/c_change_difficulty.rs b/azalea-protocol/src/packets/game/c_change_difficulty.rs index 9f857772..cdcc4792 100755 --- a/azalea-protocol/src/packets/game/c_change_difficulty.rs +++ b/azalea-protocol/src/packets/game/c_change_difficulty.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::difficulty::Difficulty; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundChangeDifficulty { pub difficulty: Difficulty, pub locked: bool, diff --git a/azalea-protocol/src/packets/game/c_chat_preview.rs b/azalea-protocol/src/packets/game/c_chat_preview.rs index 17a3e41e..e0ddd2ec 100755 --- a/azalea-protocol/src/packets/game/c_chat_preview.rs +++ b/azalea-protocol/src/packets/game/c_chat_preview.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundChatPreview { pub query_id: i32, pub preview: Option, 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 9ea0e73e..c419888b 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 b960abd9..8b0555dc 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 8b85a9a1..a8e65af4 100644 --- a/azalea-protocol/src/packets/game/c_chunks_biomes.rs +++ b/azalea-protocol/src/packets/game/c_chunks_biomes.rs @@ -1,13 +1,13 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::ChunkPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundChunksBiomes { pub chunk_biome_data: Vec, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct ChunkBiomeData { pub pos: ChunkPos, pub buffer: Vec, diff --git a/azalea-protocol/src/packets/game/c_clear_titles.rs b/azalea-protocol/src/packets/game/c_clear_titles.rs index 6a4a8497..58b67bad 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 f1fa65d7..37679a72 100755 --- a/azalea-protocol/src/packets/game/c_command_suggestions.rs +++ b/azalea-protocol/src/packets/game/c_command_suggestions.rs @@ -1,8 +1,8 @@ use azalea_brigadier::suggestion::Suggestions; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 60df57e5..1a231559 100755 --- a/azalea-protocol/src/packets/game/c_commands.rs +++ b/azalea-protocol/src/packets/game/c_commands.rs @@ -1,13 +1,11 @@ use std::io::{Cursor, Write}; -use azalea_buf::{ - BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, -}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation}; use azalea_protocol_macros::ClientboundGamePacket; use tracing::warn; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundCommands { pub entries: Vec, #[var] @@ -82,7 +80,7 @@ impl AzaleaWrite for BrigadierNumber { } } -#[derive(Debug, Clone, Copy, McBuf, PartialEq, Eq)] +#[derive(Debug, Clone, Copy, AzBuf, PartialEq, Eq)] pub enum BrigadierString { /// Reads a single word SingleWord = 0, @@ -93,7 +91,7 @@ pub enum BrigadierString { GreedyPhrase = 2, } -#[derive(Debug, Clone, McBuf, PartialEq)] +#[derive(Debug, Clone, AzBuf, PartialEq)] pub enum BrigadierParser { Bool, Float(BrigadierNumber), diff --git a/azalea-protocol/src/packets/game/c_container_close.rs b/azalea-protocol/src/packets/game/c_container_close.rs index 88ddba43..dda6153b 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundContainerClose { pub container_id: u8, } 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 2a10489b..852ce60f 100755 --- a/azalea-protocol/src/packets/game/c_container_set_content.rs +++ b/azalea-protocol/src/packets/game/c_container_set_content.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundContainerSetContent { pub container_id: i8, #[var] 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 ebcace7f..3815f5c5 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundContainerSetData { pub container_id: i8, pub id: u16, 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 32250cd5..5e3476d9 100755 --- a/azalea-protocol/src/packets/game/c_container_set_slot.rs +++ b/azalea-protocol/src/packets/game/c_container_set_slot.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundContainerSetSlot { pub container_id: i8, #[var] diff --git a/azalea-protocol/src/packets/game/c_cookie_request.rs b/azalea-protocol/src/packets/game/c_cookie_request.rs index 1cecd4f1..330b7334 100755 --- a/azalea-protocol/src/packets/game/c_cookie_request.rs +++ b/azalea-protocol/src/packets/game/c_cookie_request.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 71a2fbf2..016101b7 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 2145f312..87c27b7a 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundCustomChatCompletions { pub action: Action, pub entries: Vec, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 600f4b11..0610d63e 100755 --- a/azalea-protocol/src/packets/game/c_custom_payload.rs +++ b/azalea-protocol/src/packets/game/c_custom_payload.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_buf::UnsizedByteArray; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 e66fedfb..85eccfb7 100644 --- a/azalea-protocol/src/packets/game/c_custom_report_details.rs +++ b/azalea-protocol/src/packets/game/c_custom_report_details.rs @@ -1,9 +1,9 @@ use std::collections::HashMap; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundCustomReportDetails { // azalea doesn't implement max lengths yet diff --git a/azalea-protocol/src/packets/game/c_custom_sound.rs b/azalea-protocol/src/packets/game/c_custom_sound.rs index f7106bd5..7daadb3a 100644 --- a/azalea-protocol/src/packets/game/c_custom_sound.rs +++ b/azalea-protocol/src/packets/game/c_custom_sound.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundCustomSound { pub name: ResourceLocation, pub source: SoundSource, @@ -13,7 +13,7 @@ pub struct ClientboundCustomSound { pub pitch: f32, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum SoundSource { Master = 0, Music = 1, diff --git a/azalea-protocol/src/packets/game/c_damage_event.rs b/azalea-protocol/src/packets/game/c_damage_event.rs index 4d218511..a736f39a 100644 --- a/azalea-protocol/src/packets/game/c_damage_event.rs +++ b/azalea-protocol/src/packets/game/c_damage_event.rs @@ -1,10 +1,10 @@ use std::io::{Cursor, Write}; -use azalea_buf::{McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite}; use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundDamageEvent { #[var] pub entity_id: u32, diff --git a/azalea-protocol/src/packets/game/c_debug_sample.rs b/azalea-protocol/src/packets/game/c_debug_sample.rs index b7624ace..50550062 100755 --- a/azalea-protocol/src/packets/game/c_debug_sample.rs +++ b/azalea-protocol/src/packets/game/c_debug_sample.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use super::s_debug_sample_subscription::RemoteDebugSampleType; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundDebugSample { pub sample: Vec, 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 d151d041..d44a4553 100755 --- a/azalea-protocol/src/packets/game/c_delete_chat.rs +++ b/azalea-protocol/src/packets/game/c_delete_chat.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use super::c_player_chat::PackedMessageSignature; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 b348ea8e..ba197f1d 100755 --- a/azalea-protocol/src/packets/game/c_disconnect.rs +++ b/azalea-protocol/src/packets/game/c_disconnect.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 cc6f6d24..90dc5d64 100644 --- a/azalea-protocol/src/packets/game/c_disguised_chat.rs +++ b/azalea-protocol/src/packets/game/c_disguised_chat.rs @@ -1,4 +1,4 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::{ translatable_component::{StringOrComponent, TranslatableComponent}, FormattedText, @@ -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, McBuf, ClientboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)] 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 6ca5faee..13efbabd 100755 --- a/azalea-protocol/src/packets/game/c_entity_event.rs +++ b/azalea-protocol/src/packets/game/c_entity_event.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundEntityEvent { pub entity_id: u32, 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 735b801b..c5cde322 100755 --- a/azalea-protocol/src/packets/game/c_entity_position_sync.rs +++ b/azalea-protocol/src/packets/game/c_entity_position_sync.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundEntityPositionSync { #[var] pub id: u32, @@ -10,7 +10,7 @@ pub struct ClientboundEntityPositionSync { pub on_ground: bool, } -#[derive(McBuf, Clone, Debug)] +#[derive(AzBuf, Clone, Debug)] pub struct PositionMoveRotation { pub position: Vec3, pub delta_movement: Vec3, diff --git a/azalea-protocol/src/packets/game/c_explode.rs b/azalea-protocol/src/packets/game/c_explode.rs index 159b4178..aef3887d 100755 --- a/azalea-protocol/src/packets/game/c_explode.rs +++ b/azalea-protocol/src/packets/game/c_explode.rs @@ -3,9 +3,7 @@ use std::{ str::FromStr, }; -use azalea_buf::{ - BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, -}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_core::{position::BlockPos, resource_location::ResourceLocation}; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::{ParticleKind, SoundEvent}; @@ -26,7 +24,7 @@ pub struct ClientboundExplode { pub explosion_sound: SoundEvent, } -#[derive(Clone, Copy, Debug, PartialEq, McBuf)] +#[derive(Clone, Copy, Debug, PartialEq, AzBuf)] pub enum BlockInteraction { Keep, Destroy, 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 baa8b786..bd901634 100755 --- a/azalea-protocol/src/packets/game/c_forget_level_chunk.rs +++ b/azalea-protocol/src/packets/game/c_forget_level_chunk.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::ChunkPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 40f63348..940aa2f1 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundGameEvent { pub event: EventType, pub param: f32, } -#[derive(Clone, Debug, Copy, McBuf)] +#[derive(Clone, Debug, Copy, AzBuf)] 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 c16164bf..13a67253 100755 --- a/azalea-protocol/src/packets/game/c_horse_screen_open.rs +++ b/azalea-protocol/src/packets/game/c_horse_screen_open.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundHorseScreenOpen { pub container_id: u8, #[var] diff --git a/azalea-protocol/src/packets/game/c_hurt_animation.rs b/azalea-protocol/src/packets/game/c_hurt_animation.rs index 27ef2652..49a32989 100644 --- a/azalea-protocol/src/packets/game/c_hurt_animation.rs +++ b/azalea-protocol/src/packets/game/c_hurt_animation.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundHurtAnimation { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_initialize_border.rs b/azalea-protocol/src/packets/game/c_initialize_border.rs index fe95fa69..ca338b7f 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, ClientboundGamePacket, McBuf)] +#[derive(Clone, Debug, ClientboundGamePacket, AzBuf)] 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 7b6447d9..ff93560b 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 3ba47cbe..a4a6da45 100755 --- a/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs +++ b/azalea-protocol/src/packets/game/c_level_chunk_with_light.rs @@ -1,10 +1,10 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use simdnbt::owned::Nbt; use super::c_light_update::ClientboundLightUpdatePacketData; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundLevelChunkWithLight { pub x: i32, pub z: i32, @@ -12,7 +12,7 @@ pub struct ClientboundLevelChunkWithLight { pub light_data: ClientboundLightUpdatePacketData, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct ClientboundLevelChunkPacketData { pub heightmaps: Nbt, // we can't parse the data in azalea-protocol because it depends on context from other packets @@ -20,7 +20,7 @@ pub struct ClientboundLevelChunkPacketData { pub block_entities: Vec, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] 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 5ba76b5e..f41a1f42 100755 --- a/azalea-protocol/src/packets/game/c_level_event.rs +++ b/azalea-protocol/src/packets/game/c_level_event.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 eca5b872..d700673c 100755 --- a/azalea-protocol/src/packets/game/c_level_particles.rs +++ b/azalea-protocol/src/packets/game/c_level_particles.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_entity::particle::Particle; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundLevelParticles { pub override_limiter: bool, pub x: f64, diff --git a/azalea-protocol/src/packets/game/c_light_update.rs b/azalea-protocol/src/packets/game/c_light_update.rs index 7e10d2ff..72523291 100755 --- a/azalea-protocol/src/packets/game/c_light_update.rs +++ b/azalea-protocol/src/packets/game/c_light_update.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::bitset::BitSet; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundLightUpdate { #[var] pub x: i32, @@ -11,7 +11,7 @@ pub struct ClientboundLightUpdate { pub light_data: ClientboundLightUpdatePacketData, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] 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 6221c428..c0616c55 100755 --- a/azalea-protocol/src/packets/game/c_login.rs +++ b/azalea-protocol/src/packets/game/c_login.rs @@ -1,4 +1,4 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; @@ -8,7 +8,7 @@ use crate::packets::common::CommonPlayerSpawnInfo; /// /// This packet contains information about the state of the player, the /// world, and the registry. -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundLogin { pub player_id: u32, 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 70c483fc..9a41ed85 100755 --- a/azalea-protocol/src/packets/game/c_map_item_data.rs +++ b/azalea-protocol/src/packets/game/c_map_item_data.rs @@ -1,8 +1,8 @@ -use azalea_buf::{AzaleaRead, AzaleaWrite, McBuf}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, ClientboundGamePacket, McBuf)] +#[derive(Clone, Debug, ClientboundGamePacket, AzBuf)] pub struct ClientboundMapItemData { #[var] pub map_id: u32, @@ -12,7 +12,7 @@ pub struct ClientboundMapItemData { pub color_patch: OptionalMapPatch, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct MapDecoration { pub decoration_type: DecorationType, pub x: i8, @@ -47,7 +47,7 @@ impl AzaleaWrite for OptionalMapPatch { } } -#[derive(Debug, Clone, McBuf)] +#[derive(Debug, Clone, AzBuf)] pub struct MapPatch { pub width: u8, pub height: u8, @@ -56,7 +56,7 @@ pub struct MapPatch { pub map_colors: Vec, } -#[derive(Clone, Copy, Debug, McBuf)] +#[derive(Clone, Copy, Debug, AzBuf)] 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 00a376a4..e1822579 100755 --- a/azalea-protocol/src/packets/game/c_merchant_offers.rs +++ b/azalea-protocol/src/packets/game/c_merchant_offers.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundMerchantOffers { #[var] pub container_id: u32, @@ -15,7 +15,7 @@ pub struct ClientboundMerchantOffers { pub can_restock: bool, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct MerchantOffer { pub base_cost_a: ItemStack, pub result: ItemStack, 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 f33f4010..b153bb3c 100755 --- a/azalea-protocol/src/packets/game/c_move_entity_pos.rs +++ b/azalea-protocol/src/packets/game/c_move_entity_pos.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::delta::PositionDelta8; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundMoveEntityPos { #[var] pub entity_id: u32, 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 03558d69..7b22e290 100755 --- a/azalea-protocol/src/packets/game/c_move_entity_pos_rot.rs +++ b/azalea-protocol/src/packets/game/c_move_entity_pos_rot.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::delta::PositionDelta8; use azalea_protocol_macros::ClientboundGamePacket; /// This packet is sent by the server when an entity moves less then 8 blocks. -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundMoveEntityPosRot { #[var] pub entity_id: u32, 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 d1f07d34..a8362748 100755 --- a/azalea-protocol/src/packets/game/c_move_entity_rot.rs +++ b/azalea-protocol/src/packets/game/c_move_entity_rot.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundMoveEntityRot { #[var] pub entity_id: u32, diff --git a/azalea-protocol/src/packets/game/c_move_minecart.rs b/azalea-protocol/src/packets/game/c_move_minecart.rs index 569be41e..becf5242 100644 --- a/azalea-protocol/src/packets/game/c_move_minecart.rs +++ b/azalea-protocol/src/packets/game/c_move_minecart.rs @@ -1,15 +1,15 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundMoveMinecart { #[var] pub entity_id: u32, pub lerp_steps: Vec, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] 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 ea090984..96e3e5c2 100755 --- a/azalea-protocol/src/packets/game/c_move_vehicle.rs +++ b/azalea-protocol/src/packets/game/c_move_vehicle.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundMoveVehicle { pub x: f64, pub y: f64, diff --git a/azalea-protocol/src/packets/game/c_open_book.rs b/azalea-protocol/src/packets/game/c_open_book.rs index 793639c9..2c4f6b15 100755 --- a/azalea-protocol/src/packets/game/c_open_book.rs +++ b/azalea-protocol/src/packets/game/c_open_book.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use super::s_interact::InteractionHand; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 234d8f09..4ba71725 100755 --- a/azalea-protocol/src/packets/game/c_open_screen.rs +++ b/azalea-protocol/src/packets/game/c_open_screen.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundOpenScreen { #[var] pub container_id: u32, 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 5652bed9..52f5922c 100755 --- a/azalea-protocol/src/packets/game/c_open_sign_editor.rs +++ b/azalea-protocol/src/packets/game/c_open_sign_editor.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 44a8d9d6..956aca8d 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 fbdec4ed..41c32403 100755 --- a/azalea-protocol/src/packets/game/c_place_ghost_recipe.rs +++ b/azalea-protocol/src/packets/game/c_place_ghost_recipe.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlaceGhostRecipe { pub container_id: u8, pub recipe: ResourceLocation, diff --git a/azalea-protocol/src/packets/game/c_player_abilities.rs b/azalea-protocol/src/packets/game/c_player_abilities.rs index 84d6059e..c32a99fe 100755 --- a/azalea-protocol/src/packets/game/c_player_abilities.rs +++ b/azalea-protocol/src/packets/game/c_player_abilities.rs @@ -1,11 +1,11 @@ use std::io::{Cursor, Write}; -use azalea_buf::{BufReadError, McBuf}; +use azalea_buf::{AzBuf, BufReadError}; use azalea_buf::{AzaleaRead, AzaleaWrite}; use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlayerAbilities { pub flags: PlayerAbilitiesFlags, pub flying_speed: f32, diff --git a/azalea-protocol/src/packets/game/c_player_chat.rs b/azalea-protocol/src/packets/game/c_player_chat.rs index 4dbfe5d7..fe024ceb 100644 --- a/azalea-protocol/src/packets/game/c_player_chat.rs +++ b/azalea-protocol/src/packets/game/c_player_chat.rs @@ -1,8 +1,6 @@ use std::io::{Cursor, Write}; -use azalea_buf::{ - BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, -}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_chat::{ translatable_component::{StringOrComponent, TranslatableComponent}, FormattedText, @@ -12,7 +10,7 @@ use azalea_crypto::MessageSignature; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)] pub struct ClientboundPlayerChat { pub sender: Uuid, #[var] @@ -24,7 +22,7 @@ pub struct ClientboundPlayerChat { pub chat_type: ChatTypeBound, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct PackedSignedMessageBody { // the error is here, for some reason it skipped a byte earlier and here // it's reading `0` when it should be `11` @@ -34,7 +32,7 @@ pub struct PackedSignedMessageBody { pub last_seen: PackedLastSeenMessages, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct PackedLastSeenMessages { pub entries: Vec, } @@ -46,14 +44,14 @@ pub enum PackedMessageSignature { Id(u32), } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub enum FilterMask { PassThrough, FullyFiltered, PartiallyFiltered(BitSet), } -#[derive(Copy, Clone, Debug, McBuf, PartialEq, Eq)] +#[derive(Copy, Clone, Debug, AzBuf, PartialEq, Eq)] pub enum ChatType { Chat = 0, SayCommand = 1, @@ -64,7 +62,7 @@ pub enum ChatType { EmoteCommand = 6, } -#[derive(Clone, Debug, McBuf, PartialEq)] +#[derive(Clone, Debug, AzBuf, PartialEq)] pub struct ChatTypeBound { pub chat_type: ChatType, pub name: FormattedText, diff --git a/azalea-protocol/src/packets/game/c_player_chat_header.rs b/azalea-protocol/src/packets/game/c_player_chat_header.rs index 0964e649..d7e84cc5 100755 --- a/azalea-protocol/src/packets/game/c_player_chat_header.rs +++ b/azalea-protocol/src/packets/game/c_player_chat_header.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_crypto::{MessageSignature, SignedMessageHeader}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlayerChatHeader { pub header: SignedMessageHeader, pub header_signature: MessageSignature, 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 88b2f3a5..b8029f1b 100755 --- a/azalea-protocol/src/packets/game/c_player_combat_end.rs +++ b/azalea-protocol/src/packets/game/c_player_combat_end.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; /// Unused by the client in vanilla. -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 04683795..8c344b49 100755 --- a/azalea-protocol/src/packets/game/c_player_combat_enter.rs +++ b/azalea-protocol/src/packets/game/c_player_combat_enter.rs @@ -1,6 +1,6 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; /// Unused in vanilla. -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 f5d138fe..fb7285b5 100755 --- a/azalea-protocol/src/packets/game/c_player_combat_kill.rs +++ b/azalea-protocol/src/packets/game/c_player_combat_kill.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; /// Used to send a respawn screen. -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlayerCombatKill { #[var] pub player_id: u32, 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 708e96e1..fcaef9d4 100644 --- a/azalea-protocol/src/packets/game/c_player_info_remove.rs +++ b/azalea-protocol/src/packets/game/c_player_info_remove.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlayerInfoRemove { pub profile_ids: Vec, } 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 49202093..ba43564c 100644 --- a/azalea-protocol/src/packets/game/c_player_info_update.rs +++ b/azalea-protocol/src/packets/game/c_player_info_update.rs @@ -4,9 +4,7 @@ use std::{ }; use azalea_auth::game_profile::{GameProfile, ProfilePropertyValue}; -use azalea_buf::{ - BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, -}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_chat::FormattedText; use azalea_core::{bitset::FixedBitSet, game_type::GameMode}; use azalea_protocol_macros::ClientboundGamePacket; @@ -31,33 +29,33 @@ pub struct PlayerInfoEntry { pub chat_session: Option, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct AddPlayerAction { pub name: String, pub properties: HashMap, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct InitializeChatAction { pub chat_session: Option, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct UpdateGameModeAction { pub game_mode: GameMode, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct UpdateListedAction { pub listed: bool, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct UpdateLatencyAction { #[var] pub latency: i32, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct UpdateDisplayNameAction { pub display_name: Option, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct UpdateListOrderAction { #[var] pub list_order: i32, 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 4acfbbb3..4d886814 100755 --- a/azalea-protocol/src/packets/game/c_player_look_at.rs +++ b/azalea-protocol/src/packets/game/c_player_look_at.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlayerLookAt { pub from_anchor: Anchor, pub x: f64, @@ -10,13 +10,13 @@ pub struct ClientboundPlayerLookAt { pub entity: Option, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum Anchor { Feet = 0, Eyes = 1, } -#[derive(McBuf, Clone, Debug)] +#[derive(AzBuf, Clone, Debug)] 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 d4cfcd29..aa030fc5 100755 --- a/azalea-protocol/src/packets/game/c_player_position.rs +++ b/azalea-protocol/src/packets/game/c_player_position.rs @@ -1,10 +1,10 @@ use std::io::{Cursor, Write}; -use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; use azalea_core::{bitset::FixedBitSet, position::Vec3}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlayerPosition { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_player_rotation.rs b/azalea-protocol/src/packets/game/c_player_rotation.rs index 20570b27..33214cf9 100755 --- a/azalea-protocol/src/packets/game/c_player_rotation.rs +++ b/azalea-protocol/src/packets/game/c_player_rotation.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundPlayerRotation { pub y_rot: f32, pub x_rot: f32, diff --git a/azalea-protocol/src/packets/game/c_pong_response.rs b/azalea-protocol/src/packets/game/c_pong_response.rs index b9c3807e..835666db 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 28144244..8b453ae2 100644 --- a/azalea-protocol/src/packets/game/c_projectile_power.rs +++ b/azalea-protocol/src/packets/game/c_projectile_power.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundProjectilePower { pub id: u32, pub acceleration_power: f64, 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 137d99d6..e6b91130 100755 --- a/azalea-protocol/src/packets/game/c_recipe_book_add.rs +++ b/azalea-protocol/src/packets/game/c_recipe_book_add.rs @@ -1,21 +1,21 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use super::c_update_recipes::{Ingredient, SlotDisplayData}; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundRecipeBookAdd { pub entries: Vec, pub replace: bool, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct Entry { pub contents: RecipeDisplayEntry, pub flags: u8, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct RecipeDisplayEntry { #[var] pub id: u32, @@ -28,7 +28,7 @@ pub struct RecipeDisplayEntry { } /// [`azalea_registry::RecipeDisplay`] -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub enum RecipeDisplayData { Shapeless(ShapelessCraftingRecipeDisplay), Shaped(ShapedCraftingRecipeDisplay), @@ -37,13 +37,13 @@ pub enum RecipeDisplayData { Smithing(SmithingRecipeDisplay), } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct ShapelessCraftingRecipeDisplay { pub ingredients: Vec, pub result: SlotDisplayData, pub crafting_station: SlotDisplayData, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct ShapedCraftingRecipeDisplay { #[var] pub width: u32, @@ -53,7 +53,7 @@ pub struct ShapedCraftingRecipeDisplay { pub result: SlotDisplayData, pub crafting_station: SlotDisplayData, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct FurnaceRecipeDisplay { pub ingredient: SlotDisplayData, pub fuel: SlotDisplayData, @@ -63,13 +63,13 @@ pub struct FurnaceRecipeDisplay { pub duration: u32, pub experience: f32, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct StonecutterRecipeDisplay { pub input: SlotDisplayData, pub result: SlotDisplayData, pub crafting_station: SlotDisplayData, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct SmithingRecipeDisplay { pub template: SlotDisplayData, pub base: SlotDisplayData, 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 783bf8ae..aa5a09fe 100755 --- a/azalea-protocol/src/packets/game/c_recipe_book_remove.rs +++ b/azalea-protocol/src/packets/game/c_recipe_book_remove.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use super::{c_entity_position_sync::PositionMoveRotation, c_player_position::RelativeMovements}; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundRecipeBookRemove { #[var] pub id: 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 e2b768cd..f88a9733 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundRecipeBookSettings { pub book_settings: RecipeBookSettings, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] 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 8ad2fe29..f3eb7139 100755 --- a/azalea-protocol/src/packets/game/c_remove_entities.rs +++ b/azalea-protocol/src/packets/game/c_remove_entities.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundRemoveEntities { #[var] pub entity_ids: Vec, 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 d2ea7994..21500db3 100755 --- a/azalea-protocol/src/packets/game/c_remove_mob_effect.rs +++ b/azalea-protocol/src/packets/game/c_remove_mob_effect.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundRemoveMobEffect { #[var] pub entity_id: u32, diff --git a/azalea-protocol/src/packets/game/c_reset_score.rs b/azalea-protocol/src/packets/game/c_reset_score.rs index 8c1aae11..8a40dd0d 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundResetScore { pub owner: String, pub objective_name: Option, 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 c989be88..14150ea1 100644 --- a/azalea-protocol/src/packets/game/c_resource_pack_pop.rs +++ b/azalea-protocol/src/packets/game/c_resource_pack_pop.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundResourcePackPop { pub id: Option, } 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 b454fb86..6e355029 100644 --- a/azalea-protocol/src/packets/game/c_resource_pack_push.rs +++ b/azalea-protocol/src/packets/game/c_resource_pack_push.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 ddb03e67..79bbfd1d 100755 --- a/azalea-protocol/src/packets/game/c_respawn.rs +++ b/azalea-protocol/src/packets/game/c_respawn.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use crate::packets::common::CommonPlayerSpawnInfo; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 c2aba548..26e55948 100755 --- a/azalea-protocol/src/packets/game/c_rotate_head.rs +++ b/azalea-protocol/src/packets/game/c_rotate_head.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundRotateHead { #[var] pub entity_id: u32, 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 122e024a..4554c015 100755 --- a/azalea-protocol/src/packets/game/c_section_blocks_update.rs +++ b/azalea-protocol/src/packets/game/c_section_blocks_update.rs @@ -1,13 +1,11 @@ use std::io::{Cursor, Write}; use azalea_block::BlockState; -use azalea_buf::{ - BufReadError, McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite, -}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar, BufReadError}; use azalea_core::position::{ChunkSectionBlockPos, ChunkSectionPos}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSectionBlocksUpdate { pub section_pos: ChunkSectionPos, pub states: Vec, 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 34a5901a..eb4cc62a 100755 --- a/azalea-protocol/src/packets/game/c_select_advancements_tab.rs +++ b/azalea-protocol/src/packets/game/c_select_advancements_tab.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSelectAdvancementsTab { pub tab: Option, } diff --git a/azalea-protocol/src/packets/game/c_server_data.rs b/azalea-protocol/src/packets/game/c_server_data.rs index d59f989d..22116685 100755 --- a/azalea-protocol/src/packets/game/c_server_data.rs +++ b/azalea-protocol/src/packets/game/c_server_data.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundServerData { pub motd: FormattedText, pub icon_bytes: Option>, diff --git a/azalea-protocol/src/packets/game/c_server_links.rs b/azalea-protocol/src/packets/game/c_server_links.rs index a4f85c77..e41a6090 100644 --- a/azalea-protocol/src/packets/game/c_server_links.rs +++ b/azalea-protocol/src/packets/game/c_server_links.rs @@ -1,25 +1,25 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundServerLinks { pub links: Vec, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct ServerLinkEntry { pub kind: ServerLinkKind, pub link: String, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub enum ServerLinkKind { Known(KnownLinkKind), Component(FormattedText), } -#[derive(Clone, Copy, Debug, McBuf)] +#[derive(Clone, Copy, Debug, AzBuf)] pub enum KnownLinkKind { BugReport, CommunityGuidelines, 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 224ef06e..d08c5021 100755 --- a/azalea-protocol/src/packets/game/c_set_action_bar_text.rs +++ b/azalea-protocol/src/packets/game/c_set_action_bar_text.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 94aece4a..afc49556 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 b1a73a67..3c70a40e 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 f135b09a..6884cde6 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 c07cfb7e..e1126165 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 4314cac2..dbb2a742 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 3637591d..4ce4547c 100755 --- a/azalea-protocol/src/packets/game/c_set_camera.rs +++ b/azalea-protocol/src/packets/game/c_set_camera.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetCamera { #[var] pub camera_id: u32, 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 fe55e319..4c66213c 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 22e3a487..b992e572 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 a68a9cb2..2c10ae26 100644 --- a/azalea-protocol/src/packets/game/c_set_cursor_item.rs +++ b/azalea-protocol/src/packets/game/c_set_cursor_item.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetCursorItem { pub contents: Option, } 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 7edbe3c4..b6262ac8 100755 --- a/azalea-protocol/src/packets/game/c_set_default_spawn_position.rs +++ b/azalea-protocol/src/packets/game/c_set_default_spawn_position.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetDefaultSpawnPosition { pub pos: BlockPos, pub angle: f32, diff --git a/azalea-protocol/src/packets/game/c_set_display_chat_preview.rs b/azalea-protocol/src/packets/game/c_set_display_chat_preview.rs index b4994f3d..df2a62d4 100755 --- a/azalea-protocol/src/packets/game/c_set_display_chat_preview.rs +++ b/azalea-protocol/src/packets/game/c_set_display_chat_preview.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetDisplayChatPreview { pub enabled: bool, } 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 27ce402a..12118772 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetDisplayObjective { pub slot: DisplaySlot, pub objective_name: String, } -#[derive(Clone, Debug, Copy, McBuf)] +#[derive(Clone, Debug, Copy, AzBuf)] 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 4f4e9db1..da6536fe 100755 --- a/azalea-protocol/src/packets/game/c_set_entity_data.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_data.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_entity::EntityMetadataItems; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetEntityData { #[var] pub id: u32, 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 c06d7c27..c4ce8bdf 100755 --- a/azalea-protocol/src/packets/game/c_set_entity_link.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_link.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetEntityLink { pub source_id: u32, pub dest_id: u32, 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 4538be47..d0dd7698 100755 --- a/azalea-protocol/src/packets/game/c_set_entity_motion.rs +++ b/azalea-protocol/src/packets/game/c_set_entity_motion.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetEntityMotion { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_set_equipment.rs b/azalea-protocol/src/packets/game/c_set_equipment.rs index 1d0b3c79..637b2b52 100755 --- a/azalea-protocol/src/packets/game/c_set_equipment.rs +++ b/azalea-protocol/src/packets/game/c_set_equipment.rs @@ -1,11 +1,11 @@ use std::io::Cursor; -use azalea_buf::{BufReadError, McBuf}; +use azalea_buf::{AzBuf, BufReadError}; use azalea_buf::{AzaleaRead, AzaleaWrite}; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetEquipment { #[var] pub entity_id: u32, @@ -55,7 +55,7 @@ impl AzaleaWrite for EquipmentSlots { } } -#[derive(Clone, Debug, Copy, McBuf)] +#[derive(Clone, Debug, Copy, AzBuf)] 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 ef89a0e9..c11482a0 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 063677e9..56f3fe03 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 58ccae98..81c21651 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetHeldSlot { pub slot: u8, } diff --git a/azalea-protocol/src/packets/game/c_set_objective.rs b/azalea-protocol/src/packets/game/c_set_objective.rs index 2a53d8e2..7ddb3f71 100755 --- a/azalea-protocol/src/packets/game/c_set_objective.rs +++ b/azalea-protocol/src/packets/game/c_set_objective.rs @@ -1,17 +1,17 @@ use std::io::{Cursor, Write}; -use azalea_buf::{AzaleaRead, McBuf, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; use azalea_chat::{numbers::NumberFormat, FormattedText}; use azalea_core::objectives::ObjectiveCriteria; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetObjective { pub objective_name: String, pub method: Method, } -#[derive(Clone, Copy, Debug, McBuf)] +#[derive(Clone, Copy, Debug, AzBuf)] pub enum MethodKind { Add, Remove, diff --git a/azalea-protocol/src/packets/game/c_set_passengers.rs b/azalea-protocol/src/packets/game/c_set_passengers.rs index 21f7a71a..76fc3ca0 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 2549fc0c..ca8955ee 100644 --- a/azalea-protocol/src/packets/game/c_set_player_inventory.rs +++ b/azalea-protocol/src/packets/game/c_set_player_inventory.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetPlayerInventory { #[var] pub slot: i32, 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 fe8fda1c..38249cf3 100755 --- a/azalea-protocol/src/packets/game/c_set_player_team.rs +++ b/azalea-protocol/src/packets/game/c_set_player_team.rs @@ -1,10 +1,10 @@ use std::io::{Cursor, Write}; -use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; use azalea_chat::{style::ChatFormatting, FormattedText}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetPlayerTeam { pub name: String, pub method: Method, @@ -60,7 +60,7 @@ impl AzaleaWrite for Method { } } -#[derive(McBuf, Clone, Debug)] +#[derive(AzBuf, Clone, Debug)] pub struct Parameters { pub display_name: FormattedText, pub options: u8, diff --git a/azalea-protocol/src/packets/game/c_set_score.rs b/azalea-protocol/src/packets/game/c_set_score.rs index 80dc9c8f..5a16d134 100755 --- a/azalea-protocol/src/packets/game/c_set_score.rs +++ b/azalea-protocol/src/packets/game/c_set_score.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::{numbers::NumberFormat, FormattedText}; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 7fad59f5..2a80d1f1 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 06fdb466..31405739 100755 --- a/azalea-protocol/src/packets/game/c_set_subtitle_text.rs +++ b/azalea-protocol/src/packets/game/c_set_subtitle_text.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 6ac06975..b1970eec 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 9cbcfd4c..4ef3e590 100755 --- a/azalea-protocol/src/packets/game/c_set_title_text.rs +++ b/azalea-protocol/src/packets/game/c_set_title_text.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 6ef0da8e..cc0c37fc 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSetTitlesAnimation { pub fade_in: u32, pub stay: u32, diff --git a/azalea-protocol/src/packets/game/c_sound.rs b/azalea-protocol/src/packets/game/c_sound.rs index b7dec932..77161769 100755 --- a/azalea-protocol/src/packets/game/c_sound.rs +++ b/azalea-protocol/src/packets/game/c_sound.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::SoundEvent; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSound { pub sound: SoundEvent, pub source: SoundSource, @@ -14,7 +14,7 @@ pub struct ClientboundSound { pub seed: u64, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 241f2770..96b22cb8 100755 --- a/azalea-protocol/src/packets/game/c_sound_entity.rs +++ b/azalea-protocol/src/packets/game/c_sound_entity.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundSoundEntity { pub source: SoundSource, #[var] @@ -12,7 +12,7 @@ pub struct ClientboundSoundEntity { pub seed: u64, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum SoundSource { Master = 0, Music = 1, diff --git a/azalea-protocol/src/packets/game/c_start_configuration.rs b/azalea-protocol/src/packets/game/c_start_configuration.rs index 4723d9cd..6955b70d 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundStartConfiguration {} diff --git a/azalea-protocol/src/packets/game/c_store_cookie.rs b/azalea-protocol/src/packets/game/c_store_cookie.rs index 7593e8b7..a1deee4f 100644 --- a/azalea-protocol/src/packets/game/c_store_cookie.rs +++ b/azalea-protocol/src/packets/game/c_store_cookie.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundStoreCookie { pub key: ResourceLocation, pub payload: Vec, diff --git a/azalea-protocol/src/packets/game/c_system_chat.rs b/azalea-protocol/src/packets/game/c_system_chat.rs index 13e32491..14dfdcbf 100755 --- a/azalea-protocol/src/packets/game/c_system_chat.rs +++ b/azalea-protocol/src/packets/game/c_system_chat.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket, PartialEq)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket, PartialEq)] 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 87d92c9d..268351da 100755 --- a/azalea-protocol/src/packets/game/c_tab_list.rs +++ b/azalea-protocol/src/packets/game/c_tab_list.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 41de799d..efd94e32 100755 --- a/azalea-protocol/src/packets/game/c_tag_query.rs +++ b/azalea-protocol/src/packets/game/c_tag_query.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use simdnbt::owned::NbtTag; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 93d636ee..0dfc8552 100755 --- a/azalea-protocol/src/packets/game/c_take_item_entity.rs +++ b/azalea-protocol/src/packets/game/c_take_item_entity.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 53fdf9fb..0f026133 100755 --- a/azalea-protocol/src/packets/game/c_teleport_entity.rs +++ b/azalea-protocol/src/packets/game/c_teleport_entity.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundTeleportEntity { #[var] pub id: u32, diff --git a/azalea-protocol/src/packets/game/c_ticking_state.rs b/azalea-protocol/src/packets/game/c_ticking_state.rs index f262fa29..3e4e11c2 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 d238cd01..0a151134 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 1942c6d9..ad7de333 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 3ce8d81c..cd0c0b98 100755 --- a/azalea-protocol/src/packets/game/c_update_advancements.rs +++ b/azalea-protocol/src/packets/game/c_update_advancements.rs @@ -1,13 +1,13 @@ use std::collections::HashMap; use std::io::Cursor; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_core::resource_location::ResourceLocation; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundUpdateAdvancements { pub reset: bool, pub added: Vec, @@ -15,7 +15,7 @@ pub struct ClientboundUpdateAdvancements { pub progress: HashMap, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct Advancement { pub parent_id: Option, pub display: Option, @@ -96,7 +96,7 @@ impl azalea_buf::AzaleaRead for DisplayInfo { } } -#[derive(Clone, Debug, Copy, McBuf)] +#[derive(Clone, Debug, Copy, AzBuf)] pub enum FrameType { Task = 0, Challenge = 1, @@ -105,12 +105,12 @@ pub enum FrameType { pub type AdvancementProgress = HashMap; -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct CriterionProgress { pub date: Option, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] 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 1692e936..2b800643 100755 --- a/azalea-protocol/src/packets/game/c_update_attributes.rs +++ b/azalea-protocol/src/packets/game/c_update_attributes.rs @@ -1,16 +1,16 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_entity::attributes::AttributeModifier; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::Attribute; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundUpdateAttributes { #[var] pub entity_id: u32, pub values: Vec, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct AttributeSnapshot { pub attribute: Attribute, pub base: f64, diff --git a/azalea-protocol/src/packets/game/c_update_enabled_features.rs b/azalea-protocol/src/packets/game/c_update_enabled_features.rs index 6a4b7182..d4dac483 100644 --- a/azalea-protocol/src/packets/game/c_update_enabled_features.rs +++ b/azalea-protocol/src/packets/game/c_update_enabled_features.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundUpdateEnabledFeatures { pub features: Vec, } 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 1b8446e6..6a31ccab 100755 --- a/azalea-protocol/src/packets/game/c_update_mob_effect.rs +++ b/azalea-protocol/src/packets/game/c_update_mob_effect.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::MobEffect; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundUpdateMobEffect { #[var] pub entity_id: u32, diff --git a/azalea-protocol/src/packets/game/c_update_recipes.rs b/azalea-protocol/src/packets/game/c_update_recipes.rs index 5a57d803..38c4f37b 100755 --- a/azalea-protocol/src/packets/game/c_update_recipes.rs +++ b/azalea-protocol/src/packets/game/c_update_recipes.rs @@ -1,29 +1,29 @@ use std::collections::HashMap; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_inventory::ItemStack; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::HolderSet; -#[derive(Clone, Debug, PartialEq, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, PartialEq, AzBuf, ClientboundGamePacket)] pub struct ClientboundUpdateRecipes { pub item_sets: HashMap, pub stonecutter_recipes: Vec, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct SingleInputEntry { pub input: Ingredient, pub recipe: SelectableRecipe, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct SelectableRecipe { pub option_display: SlotDisplayData, } /// [`azalea_registry::SlotDisplay`] -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub enum SlotDisplayData { Empty, AnyFuel, @@ -35,40 +35,40 @@ pub enum SlotDisplayData { Composite(CompositeSlotDisplay), } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct ItemStackDisplay { pub item: azalea_registry::Item, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct ItemStackSlotDisplay { pub stack: ItemStack, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct TagSlotDisplay { pub tag: azalea_registry::Item, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct SmithingTrimDemoSlotDisplay { pub base: SlotDisplayData, pub material: SlotDisplayData, pub pattern: SlotDisplayData, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct WithRemainderSlotDisplay { pub input: SlotDisplayData, pub remainder: SlotDisplayData, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct CompositeSlotDisplay { pub contents: Vec, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct RecipePropertySet { pub items: Vec, } -#[derive(Clone, Debug, PartialEq, McBuf)] +#[derive(Clone, Debug, PartialEq, AzBuf)] pub struct Ingredient { pub allowed: HolderSet, } diff --git a/azalea-protocol/src/packets/game/c_update_tags.rs b/azalea-protocol/src/packets/game/c_update_tags.rs index a6e9a33d..4b63ec8f 100755 --- a/azalea-protocol/src/packets/game/c_update_tags.rs +++ b/azalea-protocol/src/packets/game/c_update_tags.rs @@ -2,12 +2,12 @@ use std::io::Cursor; use std::ops::Deref; use std::{collections::HashMap, io::Write}; -use azalea_buf::{BufReadError, McBuf, AzaleaReadVar, AzaleaWriteVar}; +use azalea_buf::{AzBuf, AzaleaReadVar, AzaleaWriteVar, BufReadError}; use azalea_buf::{AzaleaRead, AzaleaWrite}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; -#[derive(Clone, Debug, McBuf, ClientboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ClientboundGamePacket)] pub struct ClientboundUpdateTags { pub tags: TagMap, } diff --git a/azalea-protocol/src/packets/game/s_accept_teleportation.rs b/azalea-protocol/src/packets/game/s_accept_teleportation.rs index 7d18be5c..dedc125a 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 b66f2d89..159f12dc 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 @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundBlockEntityTagQuery { #[var] pub transaction_id: u32, diff --git a/azalea-protocol/src/packets/game/s_change_difficulty.rs b/azalea-protocol/src/packets/game/s_change_difficulty.rs index f991e4b4..7dcd3c83 100755 --- a/azalea-protocol/src/packets/game/s_change_difficulty.rs +++ b/azalea-protocol/src/packets/game/s_change_difficulty.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::difficulty::Difficulty; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundChangeDifficulty { pub difficulty: Difficulty, } diff --git a/azalea-protocol/src/packets/game/s_chat.rs b/azalea-protocol/src/packets/game/s_chat.rs index 4e221081..03bafd11 100755 --- a/azalea-protocol/src/packets/game/s_chat.rs +++ b/azalea-protocol/src/packets/game/s_chat.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::bitset::FixedBitSet; use azalea_crypto::MessageSignature; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundChat { pub message: String, pub timestamp: u64, @@ -12,7 +12,7 @@ pub struct ServerboundChat { pub last_seen_messages: LastSeenMessagesUpdate, } -#[derive(Clone, Debug, McBuf, Default)] +#[derive(Clone, Debug, AzBuf, Default)] pub struct LastSeenMessagesUpdate { #[var] pub messages: u32, diff --git a/azalea-protocol/src/packets/game/s_chat_ack.rs b/azalea-protocol/src/packets/game/s_chat_ack.rs index 96477ff2..d4b6efd6 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 84035ffc..4fdab9f9 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 9b5bf5f0..c20f3c6d 100755 --- a/azalea-protocol/src/packets/game/s_chat_command_signed.rs +++ b/azalea-protocol/src/packets/game/s_chat_command_signed.rs @@ -1,10 +1,10 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_crypto::MessageSignature; use azalea_protocol_macros::ServerboundGamePacket; use super::s_chat::LastSeenMessagesUpdate; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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, McBuf)] +#[derive(Clone, Debug, AzBuf)] 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 688c19b4..3d2bf34e 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 6da67e37..f3499983 100644 --- a/azalea-protocol/src/packets/game/s_chat_session_update.rs +++ b/azalea-protocol/src/packets/game/s_chat_session_update.rs @@ -1,19 +1,19 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundChatSessionUpdate { pub chat_session: RemoteChatSessionData, } -#[derive(Clone, Debug, PartialEq, Eq, McBuf)] +#[derive(Clone, Debug, PartialEq, Eq, AzBuf)] pub struct RemoteChatSessionData { pub session_id: Uuid, pub profile_public_key: ProfilePublicKeyData, } -#[derive(Clone, Debug, McBuf, PartialEq, Eq)] +#[derive(Clone, Debug, AzBuf, PartialEq, Eq)] pub struct ProfilePublicKeyData { pub expires_at: u64, pub key: Vec, 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 d8aa3564..faa50932 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 3a8d3024..5742bdb4 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundClientCommand { pub action: Action, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 722a4271..7844239f 100755 --- a/azalea-protocol/src/packets/game/s_client_information.rs +++ b/azalea-protocol/src/packets/game/s_client_information.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use crate::common::ClientInformation; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundClientInformation { pub 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 4338f452..71ee54ba 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundTickEnd {} diff --git a/azalea-protocol/src/packets/game/s_command_suggestion.rs b/azalea-protocol/src/packets/game/s_command_suggestion.rs index 6bcbf739..2e52a969 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 72539acb..58e27abb 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 834a16a5..909772f3 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundContainerButtonClick { pub container_id: u8, pub button_id: u8, diff --git a/azalea-protocol/src/packets/game/s_container_click.rs b/azalea-protocol/src/packets/game/s_container_click.rs index 5470f8f5..a6dee697 100755 --- a/azalea-protocol/src/packets/game/s_container_click.rs +++ b/azalea-protocol/src/packets/game/s_container_click.rs @@ -1,10 +1,10 @@ use std::collections::HashMap; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_inventory::{operations::ClickType, ItemStack}; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundContainerClick { pub container_id: u8, #[var] diff --git a/azalea-protocol/src/packets/game/s_container_close.rs b/azalea-protocol/src/packets/game/s_container_close.rs index 5314753f..1cb88eab 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundContainerClose { pub container_id: u8, } 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 46124c1b..73ac0280 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 7f18248c..5159d72e 100644 --- a/azalea-protocol/src/packets/game/s_cookie_response.rs +++ b/azalea-protocol/src/packets/game/s_cookie_response.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundCookieResponse { pub key: ResourceLocation, pub payload: Option>, diff --git a/azalea-protocol/src/packets/game/s_custom_payload.rs b/azalea-protocol/src/packets/game/s_custom_payload.rs index fd751062..b32f1d24 100755 --- a/azalea-protocol/src/packets/game/s_custom_payload.rs +++ b/azalea-protocol/src/packets/game/s_custom_payload.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_buf::UnsizedByteArray; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 236972e0..45051793 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundDebugSampleSubscription { pub sample_type: RemoteDebugSampleType, } -#[derive(Clone, Copy, Debug, McBuf)] +#[derive(Clone, Copy, Debug, AzBuf)] 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 3edafebd..af05a7cd 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 5b0c7db6..619e9e54 100644 --- a/azalea-protocol/src/packets/game/s_entity_tag_query.rs +++ b/azalea-protocol/src/packets/game/s_entity_tag_query.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 c3d2ffa7..cdd9cba5 100755 --- a/azalea-protocol/src/packets/game/s_interact.rs +++ b/azalea-protocol/src/packets/game/s_interact.rs @@ -1,12 +1,12 @@ use std::io::{Cursor, Write}; -use azalea_buf::{McBuf, AzaleaRead, AzaleaReadVar, AzaleaWriteVar, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaReadVar, AzaleaWrite, AzaleaWriteVar}; use azalea_core::position::Vec3; use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::BufReadError; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundInteract { #[var] pub entity_id: u32, @@ -79,7 +79,7 @@ impl AzaleaRead for ActionType { } } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum InteractionHand { MainHand = 0, OffHand = 1, diff --git a/azalea-protocol/src/packets/game/s_jigsaw_generate.rs b/azalea-protocol/src/packets/game/s_jigsaw_generate.rs index 9e2915d8..4a3b58ce 100755 --- a/azalea-protocol/src/packets/game/s_jigsaw_generate.rs +++ b/azalea-protocol/src/packets/game/s_jigsaw_generate.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 4e8ab8a8..a6806a92 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 e71773a8..72acb705 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 d3b52ca6..2e2ec0c5 100755 --- a/azalea-protocol/src/packets/game/s_move_player_pos.rs +++ b/azalea-protocol/src/packets/game/s_move_player_pos.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerPos { pub x: f64, pub y: f64, 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 5d385a92..cb0e0633 100755 --- a/azalea-protocol/src/packets/game/s_move_player_pos_rot.rs +++ b/azalea-protocol/src/packets/game/s_move_player_pos_rot.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerPosRot { pub x: f64, pub y: f64, 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 a0fd0264..c3cda3ea 100755 --- a/azalea-protocol/src/packets/game/s_move_player_rot.rs +++ b/azalea-protocol/src/packets/game/s_move_player_rot.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerRot { pub y_rot: f32, pub x_rot: f32, 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 f8244181..155841f0 100755 --- a/azalea-protocol/src/packets/game/s_move_player_status_only.rs +++ b/azalea-protocol/src/packets/game/s_move_player_status_only.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerStatusOnly { pub on_ground: bool, } diff --git a/azalea-protocol/src/packets/game/s_move_vehicle.rs b/azalea-protocol/src/packets/game/s_move_vehicle.rs index 832babd1..0452c9b0 100755 --- a/azalea-protocol/src/packets/game/s_move_vehicle.rs +++ b/azalea-protocol/src/packets/game/s_move_vehicle.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundMoveVehicle { pub x: f64, pub y: f64, diff --git a/azalea-protocol/src/packets/game/s_paddle_boat.rs b/azalea-protocol/src/packets/game/s_paddle_boat.rs index bf90ab3f..eed7addc 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundPaddleBoat { pub left: bool, pub right: bool, diff --git a/azalea-protocol/src/packets/game/s_pick_item.rs b/azalea-protocol/src/packets/game/s_pick_item.rs index 1d6b476f..289da6e7 100755 --- a/azalea-protocol/src/packets/game/s_pick_item.rs +++ b/azalea-protocol/src/packets/game/s_pick_item.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundPickItem { #[var] pub slot: u32, diff --git a/azalea-protocol/src/packets/game/s_ping_request.rs b/azalea-protocol/src/packets/game/s_ping_request.rs index 1887e720..1ea7550f 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 a3a5001b..33456948 100755 --- a/azalea-protocol/src/packets/game/s_place_recipe.rs +++ b/azalea-protocol/src/packets/game/s_place_recipe.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundPlaceRecipe { pub container_id: u8, pub recipe: ResourceLocation, diff --git a/azalea-protocol/src/packets/game/s_player_action.rs b/azalea-protocol/src/packets/game/s_player_action.rs index dfdb7ab7..5b65b746 100755 --- a/azalea-protocol/src/packets/game/s_player_action.rs +++ b/azalea-protocol/src/packets/game/s_player_action.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::direction::Direction; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundPlayerAction { pub action: Action, pub pos: BlockPos, @@ -12,7 +12,7 @@ pub struct ServerboundPlayerAction { pub sequence: u32, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 a8a86e75..72a92310 100755 --- a/azalea-protocol/src/packets/game/s_player_command.rs +++ b/azalea-protocol/src/packets/game/s_player_command.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundPlayerCommand { #[var] pub id: u32, @@ -10,7 +10,7 @@ pub struct ServerboundPlayerCommand { pub data: u32, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum Action { PressShiftKey = 0, ReleaseShiftKey = 1, diff --git a/azalea-protocol/src/packets/game/s_pong.rs b/azalea-protocol/src/packets/game/s_pong.rs index 0a82c48c..10ce0fb7 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 515131be..a31ca173 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundRecipeBookChangeSettings { pub book_type: RecipeBookType, pub is_open: bool, pub is_filtering: bool, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 622e5a9b..9eeffde9 100755 --- a/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs +++ b/azalea-protocol/src/packets/game/s_recipe_book_seen_recipe.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 e63790cd..4c913ba0 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 80bf9e61..7bdb7bb4 100755 --- a/azalea-protocol/src/packets/game/s_resource_pack.rs +++ b/azalea-protocol/src/packets/game/s_resource_pack.rs @@ -1,14 +1,14 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundResourcePack { pub id: Uuid, pub action: Action, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 7ac970ec..f46411f0 100755 --- a/azalea-protocol/src/packets/game/s_seen_advancements.rs +++ b/azalea-protocol/src/packets/game/s_seen_advancements.rs @@ -1,6 +1,6 @@ use std::io::Cursor; -use azalea_buf::{McBuf, AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; @@ -12,7 +12,7 @@ pub struct ServerboundSeenAdvancements { pub tab: Option, } -#[derive(McBuf, Clone, Copy, Debug, Eq, PartialEq)] +#[derive(AzBuf, Clone, Copy, Debug, Eq, PartialEq)] pub enum Action { OpenedTab = 0, ClosedScreen = 1, diff --git a/azalea-protocol/src/packets/game/s_select_bundle_item.rs b/azalea-protocol/src/packets/game/s_select_bundle_item.rs index 682bbaf5..727cfc5a 100644 --- a/azalea-protocol/src/packets/game/s_select_bundle_item.rs +++ b/azalea-protocol/src/packets/game/s_select_bundle_item.rs @@ -1,7 +1,7 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundSelectBundleItem { #[var] pub slot_id: i32, diff --git a/azalea-protocol/src/packets/game/s_select_trade.rs b/azalea-protocol/src/packets/game/s_select_trade.rs index 2968a33d..e0cc8aab 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 0c21c486..b0b911a1 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundSetBeacon { #[var] pub primary: Option, 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 afa76416..5efa2d44 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 9e0100a5..dacb79de 100755 --- a/azalea-protocol/src/packets/game/s_set_command_block.rs +++ b/azalea-protocol/src/packets/game/s_set_command_block.rs @@ -1,6 +1,6 @@ use std::io::Cursor; -use azalea_buf::{BufReadError, McBuf, AzaleaRead}; +use azalea_buf::{AzBuf, AzaleaRead, BufReadError}; use azalea_core::{bitset::FixedBitSet, position::BlockPos}; use azalea_protocol_macros::ServerboundGamePacket; @@ -17,7 +17,7 @@ pub struct ServerboundSetCommandBlock { pub automatic: bool, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] 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 7fefa585..0431a865 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 99bf7a1d..e4b26a64 100755 --- a/azalea-protocol/src/packets/game/s_set_creative_mode_slot.rs +++ b/azalea-protocol/src/packets/game/s_set_creative_mode_slot.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_inventory::ItemStack; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 937c91e8..1d97d4c7 100755 --- a/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs +++ b/azalea-protocol/src/packets/game/s_set_jigsaw_block.rs @@ -1,16 +1,16 @@ use std::io::Cursor; use std::io::Write; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_buf::AzaleaRead; use azalea_core::position::BlockPos; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; -use crate::packets::BufReadError; use crate::packets::AzaleaWrite; +use crate::packets::BufReadError; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 e6dae668..7f05a3a7 100755 --- 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,13 @@ use std::io::{Cursor, Write}; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_buf::{AzaleaRead, AzaleaWrite}; use azalea_core::{bitset::FixedBitSet, position::BlockPos}; use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::BufReadError; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundSetStructureBlock { pub pos: BlockPos, pub update_type: UpdateType, @@ -24,14 +24,14 @@ pub struct ServerboundSetStructureBlock { pub flags: Flags, } -#[derive(Clone, Debug, McBuf)] +#[derive(Clone, Debug, AzBuf)] pub struct BytePosition { pub x: u8, pub y: u8, pub z: u8, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum UpdateType { UpdateData = 0, SaveArea = 1, @@ -39,7 +39,7 @@ pub enum UpdateType { ScanArea = 3, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum StructureMode { Save = 0, Load = 1, @@ -47,14 +47,14 @@ pub enum StructureMode { Data = 3, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum Mirror { None = 0, LeftRight = 1, FrontBack = 2, } -#[derive(McBuf, Clone, Copy, Debug)] +#[derive(AzBuf, Clone, Copy, Debug)] pub enum Rotation { None = 0, Clockwise90 = 1, diff --git a/azalea-protocol/src/packets/game/s_sign_update.rs b/azalea-protocol/src/packets/game/s_sign_update.rs index 177f2419..c43a0978 100755 --- a/azalea-protocol/src/packets/game/s_sign_update.rs +++ b/azalea-protocol/src/packets/game/s_sign_update.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 bca4a972..68648ac6 100755 --- a/azalea-protocol/src/packets/game/s_swing.rs +++ b/azalea-protocol/src/packets/game/s_swing.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::game::s_interact::InteractionHand; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 c7a385c0..e8829530 100755 --- a/azalea-protocol/src/packets/game/s_teleport_to_entity.rs +++ b/azalea-protocol/src/packets/game/s_teleport_to_entity.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use uuid::Uuid; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundTeleportToEntity { pub uuid: Uuid, } diff --git a/azalea-protocol/src/packets/game/s_use_item.rs b/azalea-protocol/src/packets/game/s_use_item.rs index 7db59eb3..ac8ae217 100755 --- a/azalea-protocol/src/packets/game/s_use_item.rs +++ b/azalea-protocol/src/packets/game/s_use_item.rs @@ -1,9 +1,9 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::game::s_interact::InteractionHand; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, 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 d0069d11..0ad23ad2 100755 --- a/azalea-protocol/src/packets/game/s_use_item_on.rs +++ b/azalea-protocol/src/packets/game/s_use_item_on.rs @@ -1,6 +1,6 @@ use std::io::{Cursor, Write}; -use azalea_buf::{BufReadError, McBuf, AzaleaRead, AzaleaWrite}; +use azalea_buf::{AzBuf, AzaleaRead, AzaleaWrite, BufReadError}; use azalea_core::{ direction::Direction, position::{BlockPos, Vec3}, @@ -9,7 +9,7 @@ use azalea_protocol_macros::ServerboundGamePacket; use crate::packets::game::s_interact::InteractionHand; -#[derive(Clone, Debug, McBuf, ServerboundGamePacket)] +#[derive(Clone, Debug, AzBuf, ServerboundGamePacket)] pub struct ServerboundUseItemOn { pub hand: InteractionHand, pub block_hit: BlockHit, diff --git a/azalea-protocol/src/packets/handshake/s_client_intention.rs b/azalea-protocol/src/packets/handshake/s_client_intention.rs index b41fbd98..48fb2864 100755 --- a/azalea-protocol/src/packets/handshake/s_client_intention.rs +++ b/azalea-protocol/src/packets/handshake/s_client_intention.rs @@ -1,11 +1,11 @@ use std::hash::Hash; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundHandshakePacket; use crate::packets::ClientIntention; -#[derive(Hash, Clone, Debug, McBuf, ServerboundHandshakePacket)] +#[derive(Hash, Clone, Debug, AzBuf, ServerboundHandshakePacket)] pub struct ServerboundClientIntention { #[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 cfe801dd..f914def2 100755 --- a/azalea-protocol/src/packets/login/c_cookie_request.rs +++ b/azalea-protocol/src/packets/login/c_cookie_request.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_chat::FormattedText; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Clone, Debug, McBuf, ClientboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundLoginPacket)] pub struct ClientboundCookieRequest { pub key: FormattedText, } diff --git a/azalea-protocol/src/packets/login/c_custom_query.rs b/azalea-protocol/src/packets/login/c_custom_query.rs index bf9a84df..80c698e6 100755 --- a/azalea-protocol/src/packets/login/c_custom_query.rs +++ b/azalea-protocol/src/packets/login/c_custom_query.rs @@ -1,10 +1,10 @@ use std::hash::Hash; -use azalea_buf::{McBuf, UnsizedByteArray}; +use azalea_buf::{AzBuf, UnsizedByteArray}; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Hash, Clone, Debug, McBuf, ClientboundLoginPacket)] +#[derive(Hash, Clone, Debug, AzBuf, 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 4bd08d68..a8361212 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Clone, Debug, McBuf, ClientboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundLoginPacket)] pub struct ClientboundHello { // TODO: make this len thing work // #[len(20)] diff --git a/azalea-protocol/src/packets/login/c_login_compression.rs b/azalea-protocol/src/packets/login/c_login_compression.rs index d16e3067..c53e3829 100755 --- a/azalea-protocol/src/packets/login/c_login_compression.rs +++ b/azalea-protocol/src/packets/login/c_login_compression.rs @@ -1,9 +1,9 @@ use std::hash::Hash; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Hash, Clone, Debug, ClientboundLoginPacket, McBuf)] +#[derive(Hash, Clone, Debug, ClientboundLoginPacket, AzBuf)] pub struct ClientboundLoginCompression { #[var] pub compression_threshold: i32, diff --git a/azalea-protocol/src/packets/login/c_login_finished.rs b/azalea-protocol/src/packets/login/c_login_finished.rs index dbc9dd55..482ea53f 100755 --- a/azalea-protocol/src/packets/login/c_login_finished.rs +++ b/azalea-protocol/src/packets/login/c_login_finished.rs @@ -1,8 +1,8 @@ use azalea_auth::game_profile::GameProfile; -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundLoginPacket; -#[derive(Clone, Debug, McBuf, ClientboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, 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 1c381d6f..5e757600 100755 --- a/azalea-protocol/src/packets/login/s_cookie_response.rs +++ b/azalea-protocol/src/packets/login/s_cookie_response.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Clone, Debug, McBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] pub struct ServerboundCookieResponse { pub key: ResourceLocation, pub payload: Option>, diff --git a/azalea-protocol/src/packets/login/s_custom_query.rs b/azalea-protocol/src/packets/login/s_custom_query.rs index 67648ce8..39ecdcef 100755 --- a/azalea-protocol/src/packets/login/s_custom_query.rs +++ b/azalea-protocol/src/packets/login/s_custom_query.rs @@ -1,7 +1,7 @@ -use azalea_buf::{McBuf, UnsizedByteArray}; +use azalea_buf::{AzBuf, UnsizedByteArray}; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Clone, Debug, McBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] pub struct ServerboundCustomQuery { #[var] pub transaction_id: u32, 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 dc8f5778..34820294 100644 --- a/azalea-protocol/src/packets/login/s_custom_query_answer.rs +++ b/azalea-protocol/src/packets/login/s_custom_query_answer.rs @@ -1,9 +1,9 @@ use std::hash::Hash; -use azalea_buf::{McBuf, UnsizedByteArray}; +use azalea_buf::{AzBuf, UnsizedByteArray}; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Hash, Clone, Debug, McBuf, ServerboundLoginPacket)] +#[derive(Hash, Clone, Debug, AzBuf, 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 62015eda..15d27ce0 100755 --- a/azalea-protocol/src/packets/login/s_hello.rs +++ b/azalea-protocol/src/packets/login/s_hello.rs @@ -1,8 +1,8 @@ -use azalea_buf::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundLoginPacket; use uuid::Uuid; -#[derive(Clone, Debug, PartialEq, Eq, McBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, PartialEq, Eq, AzBuf, ServerboundLoginPacket)] pub struct ServerboundHello { pub name: String, pub profile_id: Uuid, diff --git a/azalea-protocol/src/packets/login/s_key.rs b/azalea-protocol/src/packets/login/s_key.rs index 515c2ef4..1b96d445 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Clone, Debug, McBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, ServerboundLoginPacket)] pub struct ServerboundKey { pub key_bytes: Vec, pub encrypted_challenge: Vec, diff --git a/azalea-protocol/src/packets/login/s_login_acknowledged.rs b/azalea-protocol/src/packets/login/s_login_acknowledged.rs index 963e58c0..e36648b6 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundLoginPacket; -#[derive(Clone, Debug, McBuf, ServerboundLoginPacket)] +#[derive(Clone, Debug, AzBuf, 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 6886e951..34a5e73b 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ClientboundStatusPacket; -#[derive(Clone, Debug, McBuf, ClientboundStatusPacket)] +#[derive(Clone, Debug, AzBuf, ClientboundStatusPacket)] pub struct ClientboundPongResponse { pub time: u64, } diff --git a/azalea-protocol/src/packets/status/s_ping_request.rs b/azalea-protocol/src/packets/status/s_ping_request.rs index cf38f4fc..34f2e062 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundStatusPacket; -#[derive(Clone, Debug, McBuf, ServerboundStatusPacket)] +#[derive(Clone, Debug, AzBuf, 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 101d1efb..662d74bf 100755 --- 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::McBuf; +use azalea_buf::AzBuf; use azalea_protocol_macros::ServerboundStatusPacket; -#[derive(Clone, Debug, McBuf, ServerboundStatusPacket)] +#[derive(Clone, Debug, AzBuf, ServerboundStatusPacket)] pub struct ServerboundStatusRequest {} diff --git a/azalea-registry/azalea-registry-macros/src/lib.rs b/azalea-registry/azalea-registry-macros/src/lib.rs index 50a9f199..2b148fd2 100755 --- a/azalea-registry/azalea-registry-macros/src/lib.rs +++ b/azalea-registry/azalea-registry-macros/src/lib.rs @@ -75,7 +75,7 @@ pub fn registry(input: TokenStream) -> TokenStream { let attributes = input.attributes; generated.extend(quote! { #(#attributes)* - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, azalea_buf::McBuf, simdnbt::ToNbtTag, simdnbt::FromNbtTag)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, azalea_buf::AzBuf, simdnbt::ToNbtTag, simdnbt::FromNbtTag)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[repr(u32)] pub enum #name { diff --git a/azalea/examples/testbot/commands.rs b/azalea/examples/testbot/commands.rs index 0e5e0f9c..9cdb3cb7 100644 --- a/azalea/examples/testbot/commands.rs +++ b/azalea/examples/testbot/commands.rs @@ -3,7 +3,7 @@ pub mod debug; pub mod movement; use azalea::brigadier::prelude::*; -use azalea::chat::Chat; +use azalea::chat::ChatPacket; use azalea::ecs::prelude::*; use azalea::entity::metadata::Player; use azalea::Client; @@ -17,7 +17,7 @@ pub type Ctx = CommandContext>; pub struct CommandSource { pub bot: Client, pub state: State, - pub chat: Chat, + pub chat: ChatPacket, } impl CommandSource { diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs index f768734a..cf01c60b 100644 --- a/azalea/src/swarm/chat.rs +++ b/azalea/src/swarm/chat.rs @@ -15,7 +15,7 @@ use std::collections::VecDeque; -use azalea_client::chat::{Chat, ChatReceivedEvent}; +use azalea_client::chat::{ChatPacket, ChatReceivedEvent}; use bevy_app::{App, Plugin, Update}; use bevy_ecs::prelude::Event; @@ -50,11 +50,11 @@ pub struct ClientChatState { /// A chat message that no other bots have seen yet was received by a bot. #[derive(Event, Debug)] -pub struct NewChatMessageEvent(Chat); +pub struct NewChatMessageEvent(ChatPacket); #[derive(Resource)] pub struct GlobalChatState { - pub chat_queue: VecDeque, + pub chat_queue: VecDeque, pub chat_min_index: usize, } @@ -176,7 +176,7 @@ mod tests { app } - fn drain_events(ecs: &mut World) -> Vec { + fn drain_events(ecs: &mut World) -> Vec { let mut system_state: SystemState>> = SystemState::new(ecs); let mut events = system_state.get_mut(ecs); @@ -193,12 +193,12 @@ mod tests { app.world.send_event(ChatReceivedEvent { entity: bot0, - packet: Chat::new("a"), + packet: ChatPacket::new("a"), }); app.update(); // the swarm should get the event immediately after the bot gets it - assert_eq!(drain_events(&mut app.world), vec![Chat::new("a")]); + assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("a")]); assert_eq!( app.world.get::(bot0).unwrap().chat_index, 1 @@ -206,7 +206,7 @@ mod tests { // and a second bot sending the event shouldn't do anything app.world.send_event(ChatReceivedEvent { entity: bot1, - packet: Chat::new("a"), + packet: ChatPacket::new("a"), }); app.update(); assert_eq!(drain_events(&mut app.world), vec![]); @@ -218,19 +218,19 @@ mod tests { // but if the first one gets it again, it should sent it again app.world.send_event(ChatReceivedEvent { entity: bot0, - packet: Chat::new("a"), + packet: ChatPacket::new("a"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![Chat::new("a")]); + assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("a")]); // alright and now the second bot got a different chat message and it should be // sent app.world.send_event(ChatReceivedEvent { entity: bot1, - packet: Chat::new("b"), + packet: ChatPacket::new("b"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![Chat::new("b")]); + assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("b")]); } #[tokio::test] @@ -242,16 +242,16 @@ mod tests { // bot0 gets a chat message app.world.send_event(ChatReceivedEvent { entity: bot0, - packet: Chat::new("a"), + packet: ChatPacket::new("a"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![Chat::new("a")]); + assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("a")]); let bot1 = app.world.spawn_empty().id(); app.world.send_event(ChatReceivedEvent { entity: bot1, - packet: Chat::new("b"), + packet: ChatPacket::new("b"), }); app.update(); - assert_eq!(drain_events(&mut app.world), vec![Chat::new("b")]); + assert_eq!(drain_events(&mut app.world), vec![ChatPacket::new("b")]); } } diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs index 83fba102..31f018cf 100644 --- a/azalea/src/swarm/mod.rs +++ b/azalea/src/swarm/mod.rs @@ -7,7 +7,7 @@ pub mod prelude; use std::{collections::HashMap, future::Future, net::SocketAddr, sync::Arc, time::Duration}; use azalea_client::{ - chat::Chat, start_ecs_runner, Account, Client, DefaultPlugins, Event, JoinError, + chat::ChatPacket, start_ecs_runner, Account, Client, DefaultPlugins, Event, JoinError, StartClientOpts, }; use azalea_protocol::{resolver, ServerAddress}; @@ -495,7 +495,7 @@ pub enum SwarmEvent { /// with the account and options from this event. Disconnect(Box, JoinOpts), /// At least one bot received a chat message. - Chat(Chat), + Chat(ChatPacket), } pub type SwarmHandleFn = fn(Swarm, SwarmEvent, SS) -> Fut; diff --git a/codegen/README.md b/codegen/README.md index b00290aa..341a432d 100755 --- a/codegen/README.md +++ b/codegen/README.md @@ -30,7 +30,7 @@ First, run `python migrate.py [new version]`. This will run a script that automa If you're lucky, that's all you're going to have to do. Look at the diff (`git diff`) and type-check the code (`cargo check`) to make sure everything is right. In the diff, specifically look for new comments that have "TODO". -If a packet is incorrect, you'll want to find it in the Minecraft source. The name of the struct should be the same or similar as the class in the vanilla source. Now, you'll have to manually write the struct for the packet. If the packet existed in the version before and it's just being updated, you can compare against that to see what was updated. Note that if a packet is particularly complicated, you may have to implement AzaleaRead and AzaleaWrite, but most of the time the `#[derive(McBuf)]` macro will be able to generate the impls correctly. Look at other existing packets as reference if you're confused. +If a packet is incorrect, you'll want to find it in the Minecraft source. The name of the struct should be the same or similar as the class in the vanilla source. Now, you'll have to manually write the struct for the packet. If the packet existed in the version before and it's just being updated, you can compare against that to see what was updated. Note that if a packet is particularly complicated, you may have to implement AzaleaRead and AzaleaWrite, but most of the time the `#[derive(AzBuf)]` macro will be able to generate the impls correctly. Look at other existing packets as reference if you're confused. Finally, test by making a bot join a world. Specifically, you'll want to test the things that were updated in the version. Setting the RUST_LOG environment variable to `debug` or `trace` may help you find the source of crashes (trace shows the first few hundred bytes for every packet received so it's typically more useful, but it may log more than you want). diff --git a/codegen/genitemcomponents.py b/codegen/genitemcomponents.py index 2f9bf2c5..73f03081 100644 --- a/codegen/genitemcomponents.py +++ b/codegen/genitemcomponents.py @@ -149,7 +149,7 @@ def add_variant(variant: str): # now insert the struct code.append('') - code.append('#[derive(Clone, PartialEq, McBuf)]') + code.append('#[derive(Clone, PartialEq, AzBuf)]') code.append(f'pub struct {variant} {{') code.append(' pub todo: todo!(), // see DataComponents.java') code.append('}') diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 67a063a1..fa214f4f 100755 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -32,9 +32,9 @@ def generate_packet(burger_packets, mappings: Mappings, target_packet_id, target packet_derive_name = f'{to_camel_case(direction)}{to_camel_case(state)}Packet' generated_packet_code.append( - f'#[derive(Clone, Debug, McBuf, {packet_derive_name})]') + f'#[derive(Clone, Debug, AzBuf, {packet_derive_name})]') uses.add(f'azalea_protocol_macros::{packet_derive_name}') - uses.add(f'azalea_buf::McBuf') + uses.add(f'azalea_buf::AzBuf') obfuscated_class_name = packet['class'].split('.')[0] class_name = mappings.get_class( diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py index 29adc247..6c335e2d 100755 --- a/codegen/lib/code/utils.py +++ b/codegen/lib/code/utils.py @@ -131,7 +131,7 @@ def burger_type_to_rust_type(burger_type, field_name: Optional[str] = None, inst field_type_rs = to_camel_case( enum_name.split('.')[-1].split('$')[-1]) extra_code.append('') - extra_code.append(f'#[derive(McBuf, Clone, Copy, Debug)]') + extra_code.append(f'#[derive(AzBuf, Clone, Copy, Debug)]') extra_code.append(f'pub enum {field_type_rs} {{') for index, variant in enumerate(enum_variants): extra_code.append(