From e9f88ce546acb57fe190740d0a74ae0ce6c8d671 Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 5 Sep 2022 10:36:48 -0500 Subject: Publish everything* to crates.io Except azalea-client since it's not ready yet --- Cargo.lock | 42 +-- azalea-brigadier/Cargo.toml | 2 + azalea-chat/Cargo.toml | 2 +- azalea-crypto/Cargo.toml | 4 +- azalea-physics/Cargo.toml | 10 +- azalea-protocol/Cargo.toml | 20 +- azalea-protocol/azalea-protocol-macros/Cargo.toml | 15 + azalea-protocol/azalea-protocol-macros/src/lib.rs | 352 +++++++++++++++++++++ azalea-protocol/packet-macros/Cargo.toml | 13 - azalea-protocol/packet-macros/src/lib.rs | 352 --------------------- .../packets/game/clientbound_add_entity_packet.rs | 2 +- .../game/clientbound_add_experience_orb_packet.rs | 2 +- .../packets/game/clientbound_add_player_packet.rs | 2 +- .../src/packets/game/clientbound_animate_packet.rs | 2 +- .../packets/game/clientbound_award_stats_packet.rs | 2 +- .../game/clientbound_block_changed_ack_packet.rs | 2 +- .../game/clientbound_block_destruction_packet.rs | 2 +- .../game/clientbound_block_entity_data_packet.rs | 2 +- .../packets/game/clientbound_block_event_packet.rs | 2 +- .../game/clientbound_block_update_packet.rs | 2 +- .../packets/game/clientbound_boss_event_packet.rs | 2 +- .../game/clientbound_change_difficulty_packet.rs | 2 +- .../game/clientbound_chat_preview_packet.rs | 2 +- .../game/clientbound_command_suggestions_packet.rs | 2 +- .../packets/game/clientbound_commands_packet.rs | 2 +- .../clientbound_container_set_content_packet.rs | 2 +- .../game/clientbound_container_set_data_packet.rs | 2 +- .../game/clientbound_container_set_slot_packet.rs | 2 +- .../packets/game/clientbound_cooldown_packet.rs | 2 +- .../clientbound_custom_chat_completions_packet.rs | 2 +- .../game/clientbound_custom_payload_packet.rs | 2 +- .../game/clientbound_custom_sound_packet.rs | 2 +- .../packets/game/clientbound_delete_chat_packet.rs | 2 +- .../packets/game/clientbound_disconnect_packet.rs | 2 +- .../game/clientbound_entity_event_packet.rs | 2 +- .../game/clientbound_entity_velocity_packet.rs | 2 +- .../src/packets/game/clientbound_explode_packet.rs | 2 +- .../game/clientbound_forget_level_chunk_packet.rs | 2 +- .../packets/game/clientbound_game_event_packet.rs | 2 +- .../game/clientbound_horse_screen_open_packet.rs | 2 +- .../game/clientbound_initialize_border_packet.rs | 2 +- .../packets/game/clientbound_keep_alive_packet.rs | 2 +- .../clientbound_level_chunk_with_light_packet.rs | 2 +- .../packets/game/clientbound_level_event_packet.rs | 2 +- .../game/clientbound_level_particles_packet.rs | 2 +- .../game/clientbound_light_update_packet.rs | 2 +- .../src/packets/game/clientbound_login_packet.rs | 2 +- .../game/clientbound_map_item_data_packet.rs | 2 +- .../game/clientbound_merchant_offers_packet.rs | 2 +- .../game/clientbound_move_entity_pos_packet.rs | 2 +- .../game/clientbound_move_entity_pos_rot_packet.rs | 2 +- .../game/clientbound_move_entity_rot_packet.rs | 2 +- .../game/clientbound_move_vehicle_packet.rs | 2 +- .../packets/game/clientbound_open_book_packet.rs | 2 +- .../packets/game/clientbound_open_screen_packet.rs | 2 +- .../game/clientbound_open_sign_editor_packet.rs | 2 +- .../src/packets/game/clientbound_ping_packet.rs | 2 +- .../game/clientbound_place_ghost_recipe_packet.rs | 2 +- .../game/clientbound_player_abilities_packet.rs | 2 +- .../game/clientbound_player_chat_header_packet.rs | 2 +- .../packets/game/clientbound_player_chat_packet.rs | 2 +- .../game/clientbound_player_combat_end_packet.rs | 2 +- .../game/clientbound_player_combat_enter_packet.rs | 2 +- .../game/clientbound_player_combat_kill_packet.rs | 2 +- .../packets/game/clientbound_player_info_packet.rs | 2 +- .../game/clientbound_player_look_at_packet.rs | 2 +- .../game/clientbound_player_position_packet.rs | 2 +- .../src/packets/game/clientbound_recipe_packet.rs | 2 +- .../game/clientbound_remove_entities_packet.rs | 2 +- .../game/clientbound_remove_mob_effect_packet.rs | 2 +- .../game/clientbound_resource_pack_packet.rs | 2 +- .../src/packets/game/clientbound_respawn_packet.rs | 2 +- .../packets/game/clientbound_rotate_head_packet.rs | 2 +- .../clientbound_section_blocks_update_packet.rs | 2 +- .../clientbound_select_advancements_tab_packet.rs | 2 +- .../packets/game/clientbound_server_data_packet.rs | 2 +- .../game/clientbound_set_action_bar_text_packet.rs | 2 +- .../game/clientbound_set_border_center_packet.rs | 2 +- .../clientbound_set_border_lerp_size_packet.rs | 2 +- .../game/clientbound_set_border_size_packet.rs | 2 +- .../clientbound_set_border_warning_delay_packet.rs | 2 +- ...ientbound_set_border_warning_distance_packet.rs | 2 +- .../packets/game/clientbound_set_camera_packet.rs | 2 +- .../game/clientbound_set_carried_item_packet.rs | 2 +- .../clientbound_set_chunk_cache_center_packet.rs | 2 +- .../clientbound_set_chunk_cache_radius_packet.rs | 2 +- ...lientbound_set_default_spawn_position_packet.rs | 2 +- .../clientbound_set_display_chat_preview_packet.rs | 2 +- .../clientbound_set_display_objective_packet.rs | 2 +- .../game/clientbound_set_entity_data_packet.rs | 2 +- .../game/clientbound_set_entity_link_packet.rs | 2 +- .../game/clientbound_set_entity_motion_packet.rs | 2 +- .../game/clientbound_set_equipment_packet.rs | 2 +- .../game/clientbound_set_experience_packet.rs | 2 +- .../packets/game/clientbound_set_health_packet.rs | 2 +- .../game/clientbound_set_objective_packet.rs | 2 +- .../game/clientbound_set_passengers_packet.rs | 2 +- .../game/clientbound_set_player_team_packet.rs | 2 +- .../packets/game/clientbound_set_score_packet.rs | 2 +- .../clientbound_set_simulation_distance_packet.rs | 2 +- .../game/clientbound_set_subtitle_text_packet.rs | 2 +- .../packets/game/clientbound_set_time_packet.rs | 2 +- .../game/clientbound_set_title_text_packet.rs | 2 +- .../clientbound_set_titles_animation_packet.rs | 2 +- .../game/clientbound_sound_entity_packet.rs | 2 +- .../src/packets/game/clientbound_sound_packet.rs | 2 +- .../packets/game/clientbound_stop_sound_packet.rs | 2 +- .../packets/game/clientbound_system_chat_packet.rs | 2 +- .../packets/game/clientbound_tab_list_packet.rs | 2 +- .../packets/game/clientbound_tag_query_packet.rs | 2 +- .../game/clientbound_take_item_entity_packet.rs | 2 +- .../game/clientbound_teleport_entity_packet.rs | 2 +- .../game/clientbound_update_advancements_packet.rs | 2 +- .../game/clientbound_update_attributes_packet.rs | 2 +- .../game/clientbound_update_mob_effect_packet.rs | 2 +- .../game/clientbound_update_recipes_packet.rs | 2 +- .../packets/game/clientbound_update_tags_packet.rs | 2 +- .../clientbound_update_view_distance_packet.rs | 2 +- azalea-protocol/src/packets/game/mod.rs | 2 +- .../serverbound_accept_teleportation_packet.rs | 2 +- .../game/serverbound_block_entity_tag_query.rs | 2 +- .../game/serverbound_change_difficulty_packet.rs | 2 +- .../packets/game/serverbound_chat_ack_packet.rs | 2 +- .../game/serverbound_chat_command_packet.rs | 2 +- .../src/packets/game/serverbound_chat_packet.rs | 2 +- .../game/serverbound_chat_preview_packet.rs | 2 +- .../game/serverbound_client_command_packet.rs | 2 +- .../game/serverbound_client_information_packet.rs | 2 +- .../game/serverbound_command_suggestion_packet.rs | 2 +- .../serverbound_container_button_click_packet.rs | 2 +- .../game/serverbound_container_click_packet.rs | 2 +- .../game/serverbound_container_close_packet.rs | 2 +- .../game/serverbound_custom_payload_packet.rs | 2 +- .../packets/game/serverbound_edit_book_packet.rs | 2 +- .../packets/game/serverbound_entity_tag_query.rs | 2 +- .../packets/game/serverbound_interact_packet.rs | 2 +- .../game/serverbound_jigsaw_generate_packet.rs | 2 +- .../packets/game/serverbound_keep_alive_packet.rs | 2 +- .../game/serverbound_lock_difficulty_packet.rs | 2 +- .../game/serverbound_move_player_pos_packet.rs | 2 +- .../game/serverbound_move_player_pos_rot_packet.rs | 2 +- .../game/serverbound_move_player_rot_packet.rs | 2 +- .../serverbound_move_player_status_only_packet.rs | 2 +- .../game/serverbound_move_vehicle_packet.rs | 2 +- .../packets/game/serverbound_paddle_boat_packet.rs | 2 +- .../packets/game/serverbound_pick_item_packet.rs | 2 +- .../game/serverbound_place_recipe_packet.rs | 2 +- .../game/serverbound_player_abilities_packet.rs | 2 +- .../game/serverbound_player_action_packet.rs | 2 +- .../game/serverbound_player_command_packet.rs | 2 +- .../game/serverbound_player_input_packet.rs | 2 +- .../src/packets/game/serverbound_pong_packet.rs | 2 +- ...rverbound_recipe_book_change_settings_packet.rs | 2 +- .../serverbound_recipe_book_seen_recipe_packet.rs | 2 +- .../packets/game/serverbound_rename_item_packet.rs | 2 +- .../game/serverbound_resource_pack_packet.rs | 2 +- .../game/serverbound_seen_advancements_packet.rs | 2 +- .../game/serverbound_select_trade_packet.rs | 2 +- .../packets/game/serverbound_set_beacon_packet.rs | 2 +- .../game/serverbound_set_carried_item_packet.rs | 2 +- .../game/serverbound_set_command_block_packet.rs | 2 +- .../serverbound_set_command_minecart_packet.rs | 2 +- .../serverbound_set_creative_mode_slot_packet.rs | 2 +- .../game/serverbound_set_jigsaw_block_packet.rs | 2 +- .../game/serverbound_set_structure_block_packet.rs | 2 +- .../packets/game/serverbound_sign_update_packet.rs | 2 +- .../src/packets/game/serverbound_swing_packet.rs | 2 +- .../game/serverbound_teleport_to_entity_packet.rs | 2 +- .../packets/game/serverbound_use_item_on_packet.rs | 2 +- .../packets/game/serverbound_use_item_packet.rs | 2 +- .../packets/handshake/client_intention_packet.rs | 2 +- azalea-protocol/src/packets/handshake/mod.rs | 2 +- .../login/clientbound_custom_query_packet.rs | 2 +- .../login/clientbound_game_profile_packet.rs | 2 +- .../src/packets/login/clientbound_hello_packet.rs | 2 +- .../login/clientbound_login_disconnect_packet.rs | 2 +- azalea-protocol/src/packets/login/mod.rs | 2 +- .../login/serverbound_custom_query_packet.rs | 2 +- .../src/packets/login/serverbound_hello_packet.rs | 2 +- .../src/packets/login/serverbound_key_packet.rs | 2 +- .../status/clientbound_pong_response_packet.rs | 2 +- azalea-protocol/src/packets/status/mod.rs | 2 +- .../status/serverbound_ping_request_packet.rs | 2 +- .../status/serverbound_status_request_packet.rs | 2 +- azalea-registry/Cargo.toml | 4 +- azalea-registry/azalea-registry-macros/Cargo.toml | 16 + azalea-registry/azalea-registry-macros/src/lib.rs | 131 ++++++++ azalea-registry/registry-macros/Cargo.toml | 14 - azalea-registry/registry-macros/src/lib.rs | 131 -------- azalea-registry/src/lib.rs | 2 +- azalea-world/Cargo.toml | 12 +- codegen/lib/code/packet.py | 2 +- codegen/lib/code/registry.py | 2 +- 193 files changed, 744 insertions(+), 730 deletions(-) create mode 100644 azalea-protocol/azalea-protocol-macros/Cargo.toml create mode 100644 azalea-protocol/azalea-protocol-macros/src/lib.rs delete mode 100755 azalea-protocol/packet-macros/Cargo.toml delete mode 100644 azalea-protocol/packet-macros/src/lib.rs create mode 100644 azalea-registry/azalea-registry-macros/Cargo.toml create mode 100644 azalea-registry/azalea-registry-macros/src/lib.rs delete mode 100644 azalea-registry/registry-macros/Cargo.toml delete mode 100644 azalea-registry/registry-macros/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index a443ce56..1412664f 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,7 +140,7 @@ dependencies = [ [[package]] name = "azalea-chat" -version = "0.1.0" +version = "0.1.1" dependencies = [ "azalea-buf", "azalea-language", @@ -237,11 +237,11 @@ dependencies = [ "azalea-core", "azalea-crypto", "azalea-nbt", + "azalea-protocol-macros", "azalea-world", "byteorder", "bytes", "flate2", - "packet-macros", "serde", "serde_json", "thiserror", @@ -251,11 +251,29 @@ dependencies = [ "uuid", ] +[[package]] +name = "azalea-protocol-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "azalea-registry" version = "0.1.0" dependencies = [ - "registry-macros", + "azalea-registry-macros", +] + +[[package]] +name = "azalea-registry-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -955,15 +973,6 @@ version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" -[[package]] -name = "packet-macros" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "parking_lot" version = "0.11.2" @@ -1149,15 +1158,6 @@ version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" -[[package]] -name = "registry-macros" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "resolv-conf" version = "0.7.0" diff --git a/azalea-brigadier/Cargo.toml b/azalea-brigadier/Cargo.toml index a7ebf618..52b9126d 100755 --- a/azalea-brigadier/Cargo.toml +++ b/azalea-brigadier/Cargo.toml @@ -1,5 +1,7 @@ [package] +description = "A port of Mojang's Brigadier command parsing and dispatching library." edition = "2021" +license = "MIT" name = "azalea-brigadier" version = "0.1.0" diff --git a/azalea-chat/Cargo.toml b/azalea-chat/Cargo.toml index 9894b49d..995d1d6c 100755 --- a/azalea-chat/Cargo.toml +++ b/azalea-chat/Cargo.toml @@ -3,7 +3,7 @@ description = "Parse Minecraft chat messages." edition = "2021" license = "MIT" name = "azalea-chat" -version = "0.1.0" +version = "0.1.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index 3947c26f..a5d88ea7 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -1,5 +1,7 @@ [package] +description = "Cryptography features used in Minecraft." edition = "2021" +license = "MIT" name = "azalea-crypto" version = "0.1.0" @@ -7,7 +9,7 @@ version = "0.1.0" [dependencies] aes = "0.8.1" -azalea-buf = {path = "../azalea-buf"} +azalea-buf = {path = "../azalea-buf", version = "^0.1.0"} cfb8 = "0.8.1" num-bigint = "^0.4.3" rand = {version = "^0.8.4", features = ["getrandom"]} diff --git a/azalea-physics/Cargo.toml b/azalea-physics/Cargo.toml index 688da161..96234236 100644 --- a/azalea-physics/Cargo.toml +++ b/azalea-physics/Cargo.toml @@ -1,16 +1,16 @@ [package] +description = "Physics for Minecraft entities." edition = "2021" +license = "MIT" name = "azalea-physics" version = "0.1.0" -description = "Physics for Minecraft entities." -license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -azalea-block = { path = "../azalea-block" } -azalea-core = { path = "../azalea-core" } -azalea-world = { path = "../azalea-world" } +azalea-block = {path = "../azalea-block", version = "^0.1.0"} +azalea-core = {path = "../azalea-core", version = "^0.1.0"} +azalea-world = {path = "../azalea-world", version = "^0.1.0"} [dev-dependencies] uuid = "^1.1.2" diff --git a/azalea-protocol/Cargo.toml b/azalea-protocol/Cargo.toml index f3e4cd74..6b7dc290 100755 --- a/azalea-protocol/Cargo.toml +++ b/azalea-protocol/Cargo.toml @@ -1,5 +1,7 @@ [package] +description = "Send and receive Minecraft packets." edition = "2021" +license = "MIT" name = "azalea-protocol" version = "0.1.0" @@ -8,18 +10,18 @@ version = "0.1.0" [dependencies] async-compression = {version = "^0.3.8", features = ["tokio", "zlib"], optional = true} async-recursion = "1.0.0" -azalea-auth = {path = "../azalea-auth"} -azalea-brigadier = {path = "../azalea-brigadier"} -azalea-buf = {path = "../azalea-buf"} -azalea-chat = {path = "../azalea-chat"} -azalea-core = {path = "../azalea-core", optional = true} -azalea-crypto = {path = "../azalea-crypto"} -azalea-nbt = {path = "../azalea-nbt"} -azalea-world = {path = "../azalea-world"} +azalea-auth = {path = "../azalea-auth", version = "^0.1.0"} +azalea-brigadier = {path = "../azalea-brigadier", version = "^0.1.0"} +azalea-buf = {path = "../azalea-buf", version = "^0.1.0"} +azalea-chat = {path = "../azalea-chat", version = "^0.1.1"} +azalea-core = {path = "../azalea-core", optional = true, version = "^0.1.0"} +azalea-crypto = {path = "../azalea-crypto", version = "^0.1.0"} +azalea-nbt = {path = "../azalea-nbt", version = "^0.1.0"} +azalea-protocol-macros = {path = "./azalea-protocol-macros", version = "^0.1.0"} +azalea-world = {path = "../azalea-world", version = "^0.1.0"} byteorder = "^1.4.3" bytes = "^1.1.0" flate2 = "1.0.23" -packet-macros = {path = "./packet-macros"} serde = {version = "1.0.130", features = ["serde_derive"]} serde_json = "^1.0.72" thiserror = "^1.0.34" diff --git a/azalea-protocol/azalea-protocol-macros/Cargo.toml b/azalea-protocol/azalea-protocol-macros/Cargo.toml new file mode 100644 index 00000000..4d6a19e5 --- /dev/null +++ b/azalea-protocol/azalea-protocol-macros/Cargo.toml @@ -0,0 +1,15 @@ +[package] +description = "Macros internally used in azalea-protocol." +edition = "2021" +license = "MIT" +name = "azalea-protocol-macros" +version = "0.1.0" + +[lib] +proc-macro = true +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +proc-macro2 = "^1.0.36" +quote = "^1.0.10" +syn = "^1.0.82" diff --git a/azalea-protocol/azalea-protocol-macros/src/lib.rs b/azalea-protocol/azalea-protocol-macros/src/lib.rs new file mode 100644 index 00000000..4f47c9a9 --- /dev/null +++ b/azalea-protocol/azalea-protocol-macros/src/lib.rs @@ -0,0 +1,352 @@ +use proc_macro::TokenStream; +use quote::quote; +use syn::{ + self, braced, + parse::{Parse, ParseStream, Result}, + parse_macro_input, DeriveInput, FieldsNamed, Ident, LitInt, Token, +}; + +fn as_packet_derive(input: TokenStream, state: proc_macro2::TokenStream) -> TokenStream { + let DeriveInput { ident, data, .. } = parse_macro_input!(input); + + let fields = match &data { + syn::Data::Struct(syn::DataStruct { fields, .. }) => fields, + _ => panic!("#[derive(*Packet)] can only be used on structs"), + }; + let FieldsNamed { named: _, .. } = match fields { + syn::Fields::Named(f) => f, + _ => panic!("#[derive(*Packet)] can only be used on structs with named fields"), + }; + + let contents = quote! { + impl #ident { + pub fn get(self) -> #state { + #state::#ident(self) + } + + pub fn write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> { + azalea_buf::McBufWritable::write_into(self, buf) + } + + pub fn read( + buf: &mut impl std::io::Read, + ) -> Result<#state, azalea_buf::BufReadError> { + use azalea_buf::McBufReadable; + Ok(Self::read_from(buf)?.get()) + } + } + }; + + contents.into() +} + +#[proc_macro_derive(ServerboundGamePacket, attributes(var))] +pub fn derive_serverbound_game_packet(input: TokenStream) -> TokenStream { + as_packet_derive(input, quote! {crate::packets::game::ServerboundGamePacket}) +} +#[proc_macro_derive(ServerboundHandshakePacket, attributes(var))] +pub fn derive_serverbound_handshake_packet(input: TokenStream) -> TokenStream { + as_packet_derive( + input, + quote! {crate::packets::handshake::ServerboundHandshakePacket}, + ) +} +#[proc_macro_derive(ServerboundLoginPacket, attributes(var))] +pub fn derive_serverbound_login_packet(input: TokenStream) -> TokenStream { + as_packet_derive( + input, + quote! {crate::packets::login::ServerboundLoginPacket}, + ) +} +#[proc_macro_derive(ServerboundStatusPacket, attributes(var))] +pub fn derive_serverbound_status_packet(input: TokenStream) -> TokenStream { + as_packet_derive( + input, + quote! {crate::packets::status::ServerboundStatusPacket}, + ) +} + +#[proc_macro_derive(ClientboundGamePacket, attributes(var))] +pub fn derive_clientbound_game_packet(input: TokenStream) -> TokenStream { + as_packet_derive(input, quote! {crate::packets::game::ClientboundGamePacket}) +} +#[proc_macro_derive(ClientboundHandshakePacket, attributes(var))] +pub fn derive_clientbound_handshake_packet(input: TokenStream) -> TokenStream { + as_packet_derive( + input, + quote! {crate::packets::handshake::ClientboundHandshakePacket}, + ) +} +#[proc_macro_derive(ClientboundLoginPacket, attributes(var))] +pub fn derive_clientbound_login_packet(input: TokenStream) -> TokenStream { + as_packet_derive( + input, + quote! {crate::packets::login::ClientboundLoginPacket}, + ) +} +#[proc_macro_derive(ClientboundStatusPacket, attributes(var))] +pub fn derive_clientbound_status_packet(input: TokenStream) -> TokenStream { + as_packet_derive( + input, + quote! {crate::packets::status::ClientboundStatusPacket}, + ) +} + +#[derive(Debug)] +struct PacketIdPair { + id: u32, + module: Ident, + name: Ident, +} +#[derive(Debug)] +struct PacketIdMap { + packets: Vec, +} + +impl Parse for PacketIdMap { + fn parse(input: ParseStream) -> Result { + let mut packets = vec![]; + + // example: + // 0x0e: clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket, + + // 0x0e + while let Ok(packet_id) = input.parse::() { + let packet_id = packet_id.base10_parse::()?; + // : + input.parse::()?; + // clientbound_change_difficulty_packet + let module: Ident = input.parse()?; + // :: + input.parse::()?; + // ClientboundChangeDifficultyPacket + let name: Ident = input.parse()?; + + packets.push(PacketIdPair { + id: packet_id, + module, + name, + }); + + if input.parse::().is_err() { + break; + } + } + + Ok(PacketIdMap { packets }) + } +} + +#[derive(Debug)] +struct DeclareStatePackets { + name: Ident, + serverbound: PacketIdMap, + clientbound: PacketIdMap, +} + +impl Parse for DeclareStatePackets { + fn parse(input: ParseStream) -> Result { + let name = input.parse()?; + input.parse::()?; + + let serverbound_token: Ident = input.parse()?; + if serverbound_token != "Serverbound" { + return Err(syn::Error::new( + serverbound_token.span(), + "Expected `Serverbound`", + )); + } + input.parse::]>()?; + let content; + braced!(content in input); + let serverbound = content.parse()?; + + input.parse::()?; + + let clientbound_token: Ident = input.parse()?; + if clientbound_token != "Clientbound" { + return Err(syn::Error::new( + clientbound_token.span(), + "Expected `Clientbound`", + )); + } + input.parse::]>()?; + let content; + braced!(content in input); + let clientbound = content.parse()?; + + Ok(DeclareStatePackets { + name, + serverbound, + clientbound, + }) + } +} +#[proc_macro] +pub fn declare_state_packets(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as DeclareStatePackets); + + let serverbound_state_name = + Ident::new(&format!("Serverbound{}", input.name), input.name.span()); + let clientbound_state_name = + Ident::new(&format!("Clientbound{}", input.name), input.name.span()); + + let state_name_litstr = syn::LitStr::new(&input.name.to_string(), input.name.span()); + + let has_serverbound_packets = !input.serverbound.packets.is_empty(); + let has_clientbound_packets = !input.clientbound.packets.is_empty(); + + let mut serverbound_enum_contents = quote!(); + let mut clientbound_enum_contents = quote!(); + let mut serverbound_id_match_contents = quote!(); + let mut clientbound_id_match_contents = quote!(); + let mut serverbound_write_match_contents = quote!(); + let mut clientbound_write_match_contents = quote!(); + let mut serverbound_read_match_contents = quote!(); + let mut clientbound_read_match_contents = quote!(); + + for PacketIdPair { id, module, name } in input.serverbound.packets { + let name_litstr = syn::LitStr::new(&name.to_string(), name.span()); + serverbound_enum_contents.extend(quote! { + #name(#module::#name), + }); + serverbound_id_match_contents.extend(quote! { + #serverbound_state_name::#name(_packet) => #id, + }); + serverbound_write_match_contents.extend(quote! { + #serverbound_state_name::#name(packet) => packet.write(buf), + }); + serverbound_read_match_contents.extend(quote! { + #id => { + let data = #module::#name::read(buf).map_err(|e| crate::read::ReadPacketError::Parse { source: e, packet_id: #id, packet_name: #name_litstr.to_string() })?; + let mut leftover = Vec::new(); + let _ = buf.read_to_end(&mut leftover); + if !leftover.is_empty() { + return Err(crate::read::ReadPacketError::LeftoverData { packet_name: #name_litstr.to_string(), data: leftover }); + } + data + }, + }); + } + for PacketIdPair { id, module, name } in input.clientbound.packets { + let name_litstr = syn::LitStr::new(&name.to_string(), name.span()); + clientbound_enum_contents.extend(quote! { + #name(#module::#name), + }); + clientbound_id_match_contents.extend(quote! { + #clientbound_state_name::#name(_packet) => #id, + }); + clientbound_write_match_contents.extend(quote! { + #clientbound_state_name::#name(packet) => packet.write(buf), + }); + clientbound_read_match_contents.extend(quote! { + #id => { + let data = #module::#name::read(buf).map_err(|e| crate::read::ReadPacketError::Parse { source: e, packet_id: #id, packet_name: #name_litstr.to_string() })?; + let mut leftover = Vec::new(); + let _ = buf.read_to_end(&mut leftover); + if !leftover.is_empty() { + return Err(crate::read::ReadPacketError::LeftoverData { packet_name: #name_litstr.to_string(), data: leftover }); + } + data + }, + }); + } + + if !has_serverbound_packets { + serverbound_id_match_contents.extend(quote! { + _ => unreachable!("This enum is empty and can't exist.") + }); + serverbound_write_match_contents.extend(quote! { + _ => unreachable!("This enum is empty and can't exist.") + }); + } + if !has_clientbound_packets { + clientbound_id_match_contents.extend(quote! { + _ => unreachable!("This enum is empty and can't exist.") + }); + clientbound_write_match_contents.extend(quote! { + _ => unreachable!("This enum is empty and can't exist.") + }); + } + + let mut contents = quote! { + #[derive(Clone, Debug)] + pub enum #serverbound_state_name + where + Self: Sized, + { + #serverbound_enum_contents + } + #[derive(Clone, Debug)] + pub enum #clientbound_state_name + where + Self: Sized, + { + #clientbound_enum_contents + } + }; + + contents.extend(quote! { + #[allow(unreachable_code)] + impl crate::packets::ProtocolPacket for #serverbound_state_name { + fn id(&self) -> u32 { + match self { + #serverbound_id_match_contents + } + } + + fn write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> { + match self { + #serverbound_write_match_contents + } + } + + /// Read a packet by its id, ConnectionProtocol, and flow + fn read( + id: u32, + buf: &mut impl std::io::Read, + ) -> Result<#serverbound_state_name, crate::read::ReadPacketError> + where + Self: Sized, + { + Ok(match id { + #serverbound_read_match_contents + _ => return Err(crate::read::ReadPacketError::UnknownPacketId { state_name: #state_name_litstr.to_string(), id }), + }) + } + } + }); + + contents.extend(quote! { + #[allow(unreachable_code)] + impl crate::packets::ProtocolPacket for #clientbound_state_name { + fn id(&self) -> u32 { + match self { + #clientbound_id_match_contents + } + } + + fn write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> { + match self { + #clientbound_write_match_contents + } + } + + /// Read a packet by its id, ConnectionProtocol, and flow + fn read( + id: u32, + buf: &mut impl std::io::Read, + ) -> Result<#clientbound_state_name, crate::read::ReadPacketError> + where + Self: Sized, + { + Ok(match id { + #clientbound_read_match_contents + _ => return Err(crate::read::ReadPacketError::UnknownPacketId { state_name: #state_name_litstr.to_string(), id }), + }) + } + } + }); + + contents.into() +} diff --git a/azalea-protocol/packet-macros/Cargo.toml b/azalea-protocol/packet-macros/Cargo.toml deleted file mode 100755 index 2c0f36d7..00000000 --- a/azalea-protocol/packet-macros/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -edition = "2021" -name = "packet-macros" -version = "0.1.0" - -[lib] -proc-macro = true -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -proc-macro2 = "^1.0.36" -quote = "^1.0.10" -syn = "^1.0.82" diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs deleted file mode 100644 index 4f47c9a9..00000000 --- a/azalea-protocol/packet-macros/src/lib.rs +++ /dev/null @@ -1,352 +0,0 @@ -use proc_macro::TokenStream; -use quote::quote; -use syn::{ - self, braced, - parse::{Parse, ParseStream, Result}, - parse_macro_input, DeriveInput, FieldsNamed, Ident, LitInt, Token, -}; - -fn as_packet_derive(input: TokenStream, state: proc_macro2::TokenStream) -> TokenStream { - let DeriveInput { ident, data, .. } = parse_macro_input!(input); - - let fields = match &data { - syn::Data::Struct(syn::DataStruct { fields, .. }) => fields, - _ => panic!("#[derive(*Packet)] can only be used on structs"), - }; - let FieldsNamed { named: _, .. } = match fields { - syn::Fields::Named(f) => f, - _ => panic!("#[derive(*Packet)] can only be used on structs with named fields"), - }; - - let contents = quote! { - impl #ident { - pub fn get(self) -> #state { - #state::#ident(self) - } - - pub fn write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> { - azalea_buf::McBufWritable::write_into(self, buf) - } - - pub fn read( - buf: &mut impl std::io::Read, - ) -> Result<#state, azalea_buf::BufReadError> { - use azalea_buf::McBufReadable; - Ok(Self::read_from(buf)?.get()) - } - } - }; - - contents.into() -} - -#[proc_macro_derive(ServerboundGamePacket, attributes(var))] -pub fn derive_serverbound_game_packet(input: TokenStream) -> TokenStream { - as_packet_derive(input, quote! {crate::packets::game::ServerboundGamePacket}) -} -#[proc_macro_derive(ServerboundHandshakePacket, attributes(var))] -pub fn derive_serverbound_handshake_packet(input: TokenStream) -> TokenStream { - as_packet_derive( - input, - quote! {crate::packets::handshake::ServerboundHandshakePacket}, - ) -} -#[proc_macro_derive(ServerboundLoginPacket, attributes(var))] -pub fn derive_serverbound_login_packet(input: TokenStream) -> TokenStream { - as_packet_derive( - input, - quote! {crate::packets::login::ServerboundLoginPacket}, - ) -} -#[proc_macro_derive(ServerboundStatusPacket, attributes(var))] -pub fn derive_serverbound_status_packet(input: TokenStream) -> TokenStream { - as_packet_derive( - input, - quote! {crate::packets::status::ServerboundStatusPacket}, - ) -} - -#[proc_macro_derive(ClientboundGamePacket, attributes(var))] -pub fn derive_clientbound_game_packet(input: TokenStream) -> TokenStream { - as_packet_derive(input, quote! {crate::packets::game::ClientboundGamePacket}) -} -#[proc_macro_derive(ClientboundHandshakePacket, attributes(var))] -pub fn derive_clientbound_handshake_packet(input: TokenStream) -> TokenStream { - as_packet_derive( - input, - quote! {crate::packets::handshake::ClientboundHandshakePacket}, - ) -} -#[proc_macro_derive(ClientboundLoginPacket, attributes(var))] -pub fn derive_clientbound_login_packet(input: TokenStream) -> TokenStream { - as_packet_derive( - input, - quote! {crate::packets::login::ClientboundLoginPacket}, - ) -} -#[proc_macro_derive(ClientboundStatusPacket, attributes(var))] -pub fn derive_clientbound_status_packet(input: TokenStream) -> TokenStream { - as_packet_derive( - input, - quote! {crate::packets::status::ClientboundStatusPacket}, - ) -} - -#[derive(Debug)] -struct PacketIdPair { - id: u32, - module: Ident, - name: Ident, -} -#[derive(Debug)] -struct PacketIdMap { - packets: Vec, -} - -impl Parse for PacketIdMap { - fn parse(input: ParseStream) -> Result { - let mut packets = vec![]; - - // example: - // 0x0e: clientbound_change_difficulty_packet::ClientboundChangeDifficultyPacket, - - // 0x0e - while let Ok(packet_id) = input.parse::() { - let packet_id = packet_id.base10_parse::()?; - // : - input.parse::()?; - // clientbound_change_difficulty_packet - let module: Ident = input.parse()?; - // :: - input.parse::()?; - // ClientboundChangeDifficultyPacket - let name: Ident = input.parse()?; - - packets.push(PacketIdPair { - id: packet_id, - module, - name, - }); - - if input.parse::().is_err() { - break; - } - } - - Ok(PacketIdMap { packets }) - } -} - -#[derive(Debug)] -struct DeclareStatePackets { - name: Ident, - serverbound: PacketIdMap, - clientbound: PacketIdMap, -} - -impl Parse for DeclareStatePackets { - fn parse(input: ParseStream) -> Result { - let name = input.parse()?; - input.parse::()?; - - let serverbound_token: Ident = input.parse()?; - if serverbound_token != "Serverbound" { - return Err(syn::Error::new( - serverbound_token.span(), - "Expected `Serverbound`", - )); - } - input.parse::]>()?; - let content; - braced!(content in input); - let serverbound = content.parse()?; - - input.parse::()?; - - let clientbound_token: Ident = input.parse()?; - if clientbound_token != "Clientbound" { - return Err(syn::Error::new( - clientbound_token.span(), - "Expected `Clientbound`", - )); - } - input.parse::]>()?; - let content; - braced!(content in input); - let clientbound = content.parse()?; - - Ok(DeclareStatePackets { - name, - serverbound, - clientbound, - }) - } -} -#[proc_macro] -pub fn declare_state_packets(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as DeclareStatePackets); - - let serverbound_state_name = - Ident::new(&format!("Serverbound{}", input.name), input.name.span()); - let clientbound_state_name = - Ident::new(&format!("Clientbound{}", input.name), input.name.span()); - - let state_name_litstr = syn::LitStr::new(&input.name.to_string(), input.name.span()); - - let has_serverbound_packets = !input.serverbound.packets.is_empty(); - let has_clientbound_packets = !input.clientbound.packets.is_empty(); - - let mut serverbound_enum_contents = quote!(); - let mut clientbound_enum_contents = quote!(); - let mut serverbound_id_match_contents = quote!(); - let mut clientbound_id_match_contents = quote!(); - let mut serverbound_write_match_contents = quote!(); - let mut clientbound_write_match_contents = quote!(); - let mut serverbound_read_match_contents = quote!(); - let mut clientbound_read_match_contents = quote!(); - - for PacketIdPair { id, module, name } in input.serverbound.packets { - let name_litstr = syn::LitStr::new(&name.to_string(), name.span()); - serverbound_enum_contents.extend(quote! { - #name(#module::#name), - }); - serverbound_id_match_contents.extend(quote! { - #serverbound_state_name::#name(_packet) => #id, - }); - serverbound_write_match_contents.extend(quote! { - #serverbound_state_name::#name(packet) => packet.write(buf), - }); - serverbound_read_match_contents.extend(quote! { - #id => { - let data = #module::#name::read(buf).map_err(|e| crate::read::ReadPacketError::Parse { source: e, packet_id: #id, packet_name: #name_litstr.to_string() })?; - let mut leftover = Vec::new(); - let _ = buf.read_to_end(&mut leftover); - if !leftover.is_empty() { - return Err(crate::read::ReadPacketError::LeftoverData { packet_name: #name_litstr.to_string(), data: leftover }); - } - data - }, - }); - } - for PacketIdPair { id, module, name } in input.clientbound.packets { - let name_litstr = syn::LitStr::new(&name.to_string(), name.span()); - clientbound_enum_contents.extend(quote! { - #name(#module::#name), - }); - clientbound_id_match_contents.extend(quote! { - #clientbound_state_name::#name(_packet) => #id, - }); - clientbound_write_match_contents.extend(quote! { - #clientbound_state_name::#name(packet) => packet.write(buf), - }); - clientbound_read_match_contents.extend(quote! { - #id => { - let data = #module::#name::read(buf).map_err(|e| crate::read::ReadPacketError::Parse { source: e, packet_id: #id, packet_name: #name_litstr.to_string() })?; - let mut leftover = Vec::new(); - let _ = buf.read_to_end(&mut leftover); - if !leftover.is_empty() { - return Err(crate::read::ReadPacketError::LeftoverData { packet_name: #name_litstr.to_string(), data: leftover }); - } - data - }, - }); - } - - if !has_serverbound_packets { - serverbound_id_match_contents.extend(quote! { - _ => unreachable!("This enum is empty and can't exist.") - }); - serverbound_write_match_contents.extend(quote! { - _ => unreachable!("This enum is empty and can't exist.") - }); - } - if !has_clientbound_packets { - clientbound_id_match_contents.extend(quote! { - _ => unreachable!("This enum is empty and can't exist.") - }); - clientbound_write_match_contents.extend(quote! { - _ => unreachable!("This enum is empty and can't exist.") - }); - } - - let mut contents = quote! { - #[derive(Clone, Debug)] - pub enum #serverbound_state_name - where - Self: Sized, - { - #serverbound_enum_contents - } - #[derive(Clone, Debug)] - pub enum #clientbound_state_name - where - Self: Sized, - { - #clientbound_enum_contents - } - }; - - contents.extend(quote! { - #[allow(unreachable_code)] - impl crate::packets::ProtocolPacket for #serverbound_state_name { - fn id(&self) -> u32 { - match self { - #serverbound_id_match_contents - } - } - - fn write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> { - match self { - #serverbound_write_match_contents - } - } - - /// Read a packet by its id, ConnectionProtocol, and flow - fn read( - id: u32, - buf: &mut impl std::io::Read, - ) -> Result<#serverbound_state_name, crate::read::ReadPacketError> - where - Self: Sized, - { - Ok(match id { - #serverbound_read_match_contents - _ => return Err(crate::read::ReadPacketError::UnknownPacketId { state_name: #state_name_litstr.to_string(), id }), - }) - } - } - }); - - contents.extend(quote! { - #[allow(unreachable_code)] - impl crate::packets::ProtocolPacket for #clientbound_state_name { - fn id(&self) -> u32 { - match self { - #clientbound_id_match_contents - } - } - - fn write(&self, buf: &mut impl std::io::Write) -> Result<(), std::io::Error> { - match self { - #clientbound_write_match_contents - } - } - - /// Read a packet by its id, ConnectionProtocol, and flow - fn read( - id: u32, - buf: &mut impl std::io::Read, - ) -> Result<#clientbound_state_name, crate::read::ReadPacketError> - where - Self: Sized, - { - Ok(match id { - #clientbound_read_match_contents - _ => return Err(crate::read::ReadPacketError::UnknownPacketId { state_name: #state_name_litstr.to_string(), id }), - }) - } - } - }); - - contents.into() -} diff --git a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs index 4b26efe7..403925f4 100644 --- a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::McBuf; use azalea_core::Vec3; +use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::entity::EntityData; -use packet_macros::ClientboundGamePacket; use uuid::Uuid; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_add_experience_orb_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_experience_orb_packet.rs index e5e89561..84edcae6 100644 --- a/azalea-protocol/src/packets/game/clientbound_add_experience_orb_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_add_experience_orb_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundAddExperienceOrbPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_add_player_packet.rs b/azalea-protocol/src/packets/game/clientbound_add_player_packet.rs index cd07d033..4a763c64 100644 --- a/azalea-protocol/src/packets/game/clientbound_add_player_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_add_player_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::McBuf; use azalea_core::Vec3; +use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::entity::EntityData; -use packet_macros::ClientboundGamePacket; use uuid::Uuid; /// This packet is sent by the server when a player comes into visible range, not when a player joins. diff --git a/azalea-protocol/src/packets/game/clientbound_animate_packet.rs b/azalea-protocol/src/packets/game/clientbound_animate_packet.rs index 0c8e0cbb..8c99b1b7 100644 --- a/azalea-protocol/src/packets/game/clientbound_animate_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_animate_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundAnimatePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_award_stats_packet.rs b/azalea-protocol/src/packets/game/clientbound_award_stats_packet.rs index fbfba57e..3629ed6f 100644 --- a/azalea-protocol/src/packets/game/clientbound_award_stats_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_award_stats_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::collections::HashMap; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs index 990fe68a..e9e57c8d 100644 --- a/azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_changed_ack_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundBlockChangedAckPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_block_destruction_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_destruction_packet.rs index 15d16a9d..18021a51 100644 --- a/azalea-protocol/src/packets/game/clientbound_block_destruction_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_destruction_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundBlockDestructionPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs index e0991e89..dbf0ae65 100644 --- a/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_entity_data_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundBlockEntityDataPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_block_event_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_event_packet.rs index 7175da7a..124950f1 100644 --- a/azalea-protocol/src/packets/game/clientbound_block_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_event_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundBlockEventPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_block_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_block_update_packet.rs index dedcc5db..44629c82 100644 --- a/azalea-protocol/src/packets/game/clientbound_block_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_update_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundBlockUpdatePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_boss_event_packet.rs b/azalea-protocol/src/packets/game/clientbound_boss_event_packet.rs index 396513b7..ed7647e9 100644 --- a/azalea-protocol/src/packets/game/clientbound_boss_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_boss_event_packet.rs @@ -4,7 +4,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_change_difficulty_packet.rs b/azalea-protocol/src/packets/game/clientbound_change_difficulty_packet.rs index a1769364..4a956901 100755 --- a/azalea-protocol/src/packets/game/clientbound_change_difficulty_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_change_difficulty_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::Difficulty; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundChangeDifficultyPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs b/azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs index ca31bdd0..f6343f73 100644 --- a/azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_chat_preview_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundChatPreviewPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_command_suggestions_packet.rs b/azalea-protocol/src/packets/game/clientbound_command_suggestions_packet.rs index fc5cfc23..42c5580f 100644 --- a/azalea-protocol/src/packets/game/clientbound_command_suggestions_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_command_suggestions_packet.rs @@ -5,7 +5,7 @@ use azalea_buf::{ McBufReadable, McBufWritable, }; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs index 1f0aa24f..0777657a 100644 --- a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs @@ -3,7 +3,7 @@ use azalea_buf::McBuf; use azalea_buf::McBufVarReadable; use azalea_buf::{McBufReadable, McBufWritable}; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::{ hash::Hash, io::{Read, Write}, diff --git a/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs b/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs index 0157e1d9..0e9ce32b 100644 --- a/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_container_set_content_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::Slot; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundContainerSetContentPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_container_set_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_container_set_data_packet.rs index de4941ca..e09c16d7 100644 --- a/azalea-protocol/src/packets/game/clientbound_container_set_data_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_container_set_data_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundContainerSetDataPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_container_set_slot_packet.rs b/azalea-protocol/src/packets/game/clientbound_container_set_slot_packet.rs index f74470e7..0ed249a9 100644 --- a/azalea-protocol/src/packets/game/clientbound_container_set_slot_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_container_set_slot_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::Slot; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundContainerSetSlotPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_cooldown_packet.rs b/azalea-protocol/src/packets/game/clientbound_cooldown_packet.rs index b13cdde3..36795575 100644 --- a/azalea-protocol/src/packets/game/clientbound_cooldown_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_cooldown_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundCooldownPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_custom_chat_completions_packet.rs b/azalea-protocol/src/packets/game/clientbound_custom_chat_completions_packet.rs index b257c8f8..3165bbbe 100644 --- a/azalea-protocol/src/packets/game/clientbound_custom_chat_completions_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_custom_chat_completions_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundCustomChatCompletionsPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_custom_payload_packet.rs b/azalea-protocol/src/packets/game/clientbound_custom_payload_packet.rs index 7e429b4a..e5ad6af0 100755 --- a/azalea-protocol/src/packets/game/clientbound_custom_payload_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_custom_payload_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::McBuf; use azalea_buf::UnsizedByteArray; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundCustomPayloadPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_custom_sound_packet.rs b/azalea-protocol/src/packets/game/clientbound_custom_sound_packet.rs index 2d6286a3..2f7aa28e 100644 --- a/azalea-protocol/src/packets/game/clientbound_custom_sound_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_custom_sound_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use super::clientbound_sound_packet::SoundSource; diff --git a/azalea-protocol/src/packets/game/clientbound_delete_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_delete_chat_packet.rs index 055462fa..6f1a3665 100644 --- a/azalea-protocol/src/packets/game/clientbound_delete_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_delete_chat_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_crypto::MessageSignature; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundDeleteChatPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_disconnect_packet.rs b/azalea-protocol/src/packets/game/clientbound_disconnect_packet.rs index cd476162..bc4b83cb 100644 --- a/azalea-protocol/src/packets/game/clientbound_disconnect_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_disconnect_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundDisconnectPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_entity_event_packet.rs b/azalea-protocol/src/packets/game/clientbound_entity_event_packet.rs index 93bed1d4..18076a33 100644 --- a/azalea-protocol/src/packets/game/clientbound_entity_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_entity_event_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundEntityEventPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_entity_velocity_packet.rs b/azalea-protocol/src/packets/game/clientbound_entity_velocity_packet.rs index 9dd3be8a..148e0363 100644 --- a/azalea-protocol/src/packets/game/clientbound_entity_velocity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_entity_velocity_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundEntityVelocityPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs index 25731bcf..97f58782 100644 --- a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, PartialEq, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_forget_level_chunk_packet.rs b/azalea-protocol/src/packets/game/clientbound_forget_level_chunk_packet.rs index c8bf6042..f25ba3a4 100644 --- a/azalea-protocol/src/packets/game/clientbound_forget_level_chunk_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_forget_level_chunk_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundForgetLevelChunkPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs b/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs index 71552783..bd1b2ab6 100644 --- a/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_game_event_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundGameEventPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_horse_screen_open_packet.rs b/azalea-protocol/src/packets/game/clientbound_horse_screen_open_packet.rs index f5b8c463..ad3f7b37 100644 --- a/azalea-protocol/src/packets/game/clientbound_horse_screen_open_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_horse_screen_open_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundHorseScreenOpenPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_initialize_border_packet.rs b/azalea-protocol/src/packets/game/clientbound_initialize_border_packet.rs index 851c946f..f33d75a4 100644 --- a/azalea-protocol/src/packets/game/clientbound_initialize_border_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_initialize_border_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundInitializeBorderPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_keep_alive_packet.rs b/azalea-protocol/src/packets/game/clientbound_keep_alive_packet.rs index 9c4927ca..16fe3357 100644 --- a/azalea-protocol/src/packets/game/clientbound_keep_alive_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_keep_alive_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundKeepAlivePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs b/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs index 7842d1d9..1a8cf3df 100644 --- a/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_level_chunk_with_light_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use super::clientbound_light_update_packet::ClientboundLightUpdatePacketData; diff --git a/azalea-protocol/src/packets/game/clientbound_level_event_packet.rs b/azalea-protocol/src/packets/game/clientbound_level_event_packet.rs index 23e98c6b..6dbefb38 100644 --- a/azalea-protocol/src/packets/game/clientbound_level_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_level_event_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundLevelEventPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs b/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs index d85f39cb..fdde6ec9 100644 --- a/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_level_particles_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBufReadable, McBufVarReadable, McBufWritable}; use azalea_core::ParticleData; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs index e7fa936f..b4d0d0e5 100644 --- a/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BitSet; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundLightUpdatePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_login_packet.rs b/azalea-protocol/src/packets/game/clientbound_login_packet.rs index 2c895b88..149f1e3f 100755 --- a/azalea-protocol/src/packets/game/clientbound_login_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_login_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::{GameType, GlobalPos, OptionalGameType, ResourceLocation}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundLoginPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_map_item_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_map_item_data_packet.rs index e79e056e..be6b13fc 100644 --- a/azalea-protocol/src/packets/game/clientbound_map_item_data_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_map_item_data_packet.rs @@ -3,7 +3,7 @@ use std::io::{Read, Write}; use azalea_buf::{BufReadError, McBuf}; use azalea_buf::{McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, ClientboundGamePacket)] pub struct ClientboundMapItemDataPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_merchant_offers_packet.rs b/azalea-protocol/src/packets/game/clientbound_merchant_offers_packet.rs index 0c35f81d..21ac8b2e 100644 --- a/azalea-protocol/src/packets/game/clientbound_merchant_offers_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_merchant_offers_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::Slot; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundMerchantOffersPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_move_entity_pos_packet.rs b/azalea-protocol/src/packets/game/clientbound_move_entity_pos_packet.rs index 6e2b9b63..593234a1 100644 --- a/azalea-protocol/src/packets/game/clientbound_move_entity_pos_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_move_entity_pos_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::PositionDelta8; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundMoveEntityPosPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_move_entity_pos_rot_packet.rs b/azalea-protocol/src/packets/game/clientbound_move_entity_pos_rot_packet.rs index 3f7da4b0..ff274bd9 100644 --- a/azalea-protocol/src/packets/game/clientbound_move_entity_pos_rot_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_move_entity_pos_rot_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::PositionDelta8; -use packet_macros::ClientboundGamePacket; +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)] diff --git a/azalea-protocol/src/packets/game/clientbound_move_entity_rot_packet.rs b/azalea-protocol/src/packets/game/clientbound_move_entity_rot_packet.rs index 08124e53..666abe23 100644 --- a/azalea-protocol/src/packets/game/clientbound_move_entity_rot_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_move_entity_rot_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundMoveEntityRotPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_move_vehicle_packet.rs b/azalea-protocol/src/packets/game/clientbound_move_vehicle_packet.rs index 93b65e19..d2376c35 100644 --- a/azalea-protocol/src/packets/game/clientbound_move_vehicle_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_move_vehicle_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundMoveVehiclePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_open_book_packet.rs b/azalea-protocol/src/packets/game/clientbound_open_book_packet.rs index 98d512d1..bf27d4e0 100644 --- a/azalea-protocol/src/packets/game/clientbound_open_book_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_open_book_packet.rs @@ -1,6 +1,6 @@ use super::serverbound_interact_packet::InteractionHand; use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundOpenBookPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_open_screen_packet.rs b/azalea-protocol/src/packets/game/clientbound_open_screen_packet.rs index 43ab7716..b526b210 100644 --- a/azalea-protocol/src/packets/game/clientbound_open_screen_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_open_screen_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundOpenScreenPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_open_sign_editor_packet.rs b/azalea-protocol/src/packets/game/clientbound_open_sign_editor_packet.rs index 477b8f6b..b317765e 100644 --- a/azalea-protocol/src/packets/game/clientbound_open_sign_editor_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_open_sign_editor_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundOpenSignEditorPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_ping_packet.rs b/azalea-protocol/src/packets/game/clientbound_ping_packet.rs index 01e32a11..0bd2c8c3 100644 --- a/azalea-protocol/src/packets/game/clientbound_ping_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_ping_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPingPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_place_ghost_recipe_packet.rs b/azalea-protocol/src/packets/game/clientbound_place_ghost_recipe_packet.rs index accaeb8c..8951fa3e 100644 --- a/azalea-protocol/src/packets/game/clientbound_place_ghost_recipe_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_place_ghost_recipe_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPlaceGhostRecipePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs index 997b8ed7..2196d1c1 100755 --- a/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_abilities_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBuf}; use azalea_buf::{McBufReadable, McBufWritable}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_player_chat_header_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_chat_header_packet.rs index cb3ad00b..0e86a36d 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_chat_header_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_chat_header_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_crypto::{MessageSignature, SignedMessageHeader}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPlayerChatHeaderPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs index 6b4582ba..7192f88a 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs @@ -4,7 +4,7 @@ use azalea_buf::{ use azalea_chat::component::Component; use azalea_core::BitSet; use azalea_crypto::{MessageSignature, SignedMessageHeader}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; use uuid::Uuid; diff --git a/azalea-protocol/src/packets/game/clientbound_player_combat_end_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_combat_end_packet.rs index 3839716c..0276d379 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_combat_end_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_combat_end_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPlayerCombatEndPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_player_combat_enter_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_combat_enter_packet.rs index 80269e78..8e7ef8a2 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_combat_enter_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_combat_enter_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPlayerCombatEnterPacket {} diff --git a/azalea-protocol/src/packets/game/clientbound_player_combat_kill_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_combat_kill_packet.rs index eae2a711..0492d16a 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_combat_kill_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_combat_kill_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPlayerCombatKillPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs index 85e285b6..8fb2d644 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_info_packet.rs @@ -2,7 +2,7 @@ use crate::packets::login::serverbound_hello_packet::ProfilePublicKeyData; use azalea_buf::{BufReadError, McBuf}; use azalea_buf::{McBufReadable, McBufWritable}; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; use uuid::Uuid; diff --git a/azalea-protocol/src/packets/game/clientbound_player_look_at_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_look_at_packet.rs index 59567da6..47c63d1f 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_look_at_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_look_at_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundPlayerLookAtPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs index 8396b0ef..842fc258 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBuf}; use azalea_buf::{McBufReadable, McBufWritable}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs b/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs index dd7a162c..546eb6e4 100644 --- a/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs @@ -2,7 +2,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, ClientboundGamePacket)] pub struct ClientboundRecipePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_remove_entities_packet.rs b/azalea-protocol/src/packets/game/clientbound_remove_entities_packet.rs index 55ce36a5..7b192333 100644 --- a/azalea-protocol/src/packets/game/clientbound_remove_entities_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_remove_entities_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundRemoveEntitiesPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_remove_mob_effect_packet.rs b/azalea-protocol/src/packets/game/clientbound_remove_mob_effect_packet.rs index 98224bff..38265271 100644 --- a/azalea-protocol/src/packets/game/clientbound_remove_mob_effect_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_remove_mob_effect_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundRemoveMobEffectPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_resource_pack_packet.rs b/azalea-protocol/src/packets/game/clientbound_resource_pack_packet.rs index 4d82e187..e31ebaa4 100644 --- a/azalea-protocol/src/packets/game/clientbound_resource_pack_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_resource_pack_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundResourcePackPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_respawn_packet.rs b/azalea-protocol/src/packets/game/clientbound_respawn_packet.rs index d5da4392..0ad1e706 100644 --- a/azalea-protocol/src/packets/game/clientbound_respawn_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_respawn_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::{GameType, GlobalPos, OptionalGameType, ResourceLocation}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundRespawnPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_rotate_head_packet.rs b/azalea-protocol/src/packets/game/clientbound_rotate_head_packet.rs index 01d6e805..2bc77540 100644 --- a/azalea-protocol/src/packets/game/clientbound_rotate_head_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_rotate_head_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundRotateHeadPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs index 5dee398e..3f41b3c2 100644 --- a/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::{BufReadError, McBuf}; use azalea_buf::{McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; use azalea_core::{ChunkSectionBlockPos, ChunkSectionPos}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_select_advancements_tab_packet.rs b/azalea-protocol/src/packets/game/clientbound_select_advancements_tab_packet.rs index 7eddbf95..eee48df8 100644 --- a/azalea-protocol/src/packets/game/clientbound_select_advancements_tab_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_select_advancements_tab_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSelectAdvancementsTabPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_server_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_server_data_packet.rs index 3213ebc7..b1147305 100644 --- a/azalea-protocol/src/packets/game/clientbound_server_data_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_server_data_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundServerDataPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_action_bar_text_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_action_bar_text_packet.rs index f5e6915f..aefe072f 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_action_bar_text_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_action_bar_text_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetActionBarTextPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_border_center_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_border_center_packet.rs index 2b01ea9f..d210b0ce 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_border_center_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_border_center_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetBorderCenterPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_border_lerp_size_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_border_lerp_size_packet.rs index b0a415c1..5c80e897 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_border_lerp_size_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_border_lerp_size_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetBorderLerpSizePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_border_size_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_border_size_packet.rs index 87b66622..3a86a720 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_border_size_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_border_size_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetBorderSizePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_border_warning_delay_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_border_warning_delay_packet.rs index 46f5be8c..4bf794ac 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_border_warning_delay_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_border_warning_delay_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetBorderWarningDelayPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_border_warning_distance_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_border_warning_distance_packet.rs index 70069bf9..ef1b6e17 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_border_warning_distance_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_border_warning_distance_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetBorderWarningDistancePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_camera_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_camera_packet.rs index 45e62c4b..9da75dc7 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_camera_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_camera_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetCameraPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_carried_item_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_carried_item_packet.rs index 0eab3762..0eff02a8 100755 --- a/azalea-protocol/src/packets/game/clientbound_set_carried_item_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_carried_item_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; /// Sent to change the player's slot selection. #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center_packet.rs index 6c6a632d..e9aecba9 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_center_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetChunkCacheCenterPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_radius_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_radius_packet.rs index df545ace..9718ca56 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_radius_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_chunk_cache_radius_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetChunkCacheRadiusPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_default_spawn_position_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_default_spawn_position_packet.rs index 15db8709..9ac40427 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_default_spawn_position_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_default_spawn_position_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetDefaultSpawnPositionPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs index 757608ed..5aee614e 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_display_chat_preview_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetDisplayChatPreviewPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_display_objective_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_display_objective_packet.rs index 7dabff72..bf63d7da 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_display_objective_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_display_objective_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetDisplayObjectivePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs index 35319acc..05c89296 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_entity_data_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; +use azalea_protocol_macros::ClientboundGamePacket; use azalea_world::entity::EntityMetadata; -use packet_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetEntityDataPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_entity_link_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_entity_link_packet.rs index 95c6a8af..ac9dd944 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_entity_link_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_entity_link_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetEntityLinkPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_entity_motion_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_entity_motion_packet.rs index 50301982..4dcd807d 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_entity_motion_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_entity_motion_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetEntityMotionPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_equipment_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_equipment_packet.rs index 35f0d251..9398fb69 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_equipment_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_equipment_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBuf}; use azalea_core::Slot; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use azalea_buf::{McBufReadable, McBufWritable}; diff --git a/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs index de615444..f9590e26 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_experience_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetExperiencePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_health_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_health_packet.rs index f15ea34f..72b7554d 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_health_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_health_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetHealthPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_objective_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_objective_packet.rs index 4165e03c..a9c1c859 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_objective_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_objective_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_set_passengers_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_passengers_packet.rs index 39d8e3be..ac337d6e 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_passengers_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_passengers_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetPassengersPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_player_team_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_player_team_packet.rs index 7db043ff..76025024 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_player_team_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_player_team_packet.rs @@ -2,7 +2,7 @@ use std::io::{Read, Write}; use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; use azalea_chat::{component::Component, style::ChatFormatting}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetPlayerTeamPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_score_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_score_packet.rs index d1482828..ac1e0bf3 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_score_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_score_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::{BufReadError, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::{ io::{Read, Write}, ops::Not, diff --git a/azalea-protocol/src/packets/game/clientbound_set_simulation_distance_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_simulation_distance_packet.rs index 9a938e86..3efd1fa6 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_simulation_distance_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_simulation_distance_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetSimulationDistancePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_subtitle_text_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_subtitle_text_packet.rs index 1312b78f..d1a3b281 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_subtitle_text_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_subtitle_text_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetSubtitleTextPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_time_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_time_packet.rs index d9b85216..dd8a0daa 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_time_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_time_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetTimePacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_title_text_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_title_text_packet.rs index 28d06a55..c6e5f0e8 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_title_text_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_title_text_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetTitleTextPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_set_titles_animation_packet.rs b/azalea-protocol/src/packets/game/clientbound_set_titles_animation_packet.rs index a4e4f353..06faeb3c 100644 --- a/azalea-protocol/src/packets/game/clientbound_set_titles_animation_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_set_titles_animation_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSetTitlesAnimationPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_sound_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_sound_entity_packet.rs index 40648311..9f8ab9e4 100644 --- a/azalea-protocol/src/packets/game/clientbound_sound_entity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_sound_entity_packet.rs @@ -1,6 +1,6 @@ use super::clientbound_sound_packet::SoundSource; use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSoundEntityPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_sound_packet.rs b/azalea-protocol/src/packets/game/clientbound_sound_packet.rs index 99d70482..5f67714d 100644 --- a/azalea-protocol/src/packets/game/clientbound_sound_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_sound_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSoundPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_stop_sound_packet.rs b/azalea-protocol/src/packets/game/clientbound_stop_sound_packet.rs index cdf7cd47..ee650afb 100644 --- a/azalea-protocol/src/packets/game/clientbound_stop_sound_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_stop_sound_packet.rs @@ -2,7 +2,7 @@ use std::io::{Read, Write}; use azalea_buf::{BufReadError, McBufReadable, McBufWritable}; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use super::clientbound_sound_packet::SoundSource; diff --git a/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs index d7559ce0..4e5222b7 100644 --- a/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_system_chat_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundSystemChatPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_tab_list_packet.rs b/azalea-protocol/src/packets/game/clientbound_tab_list_packet.rs index b12cb124..49f357b2 100644 --- a/azalea-protocol/src/packets/game/clientbound_tab_list_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_tab_list_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundTabListPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_tag_query_packet.rs b/azalea-protocol/src/packets/game/clientbound_tag_query_packet.rs index 62da50e2..ff9f4ba1 100644 --- a/azalea-protocol/src/packets/game/clientbound_tag_query_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_tag_query_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundTagQueryPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_take_item_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_take_item_entity_packet.rs index f1e1ef33..9e29a0fe 100644 --- a/azalea-protocol/src/packets/game/clientbound_take_item_entity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_take_item_entity_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundTakeItemEntityPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs b/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs index 774e0c1d..05a912ba 100644 --- a/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_teleport_entity_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundTeleportEntityPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs index 88cb15e9..f0f33b36 100644 --- a/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; use azalea_chat::component::Component; use azalea_core::{ResourceLocation, Slot}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::{ collections::HashMap, io::{Read, Write}, diff --git a/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs index 518b402c..5c03d11f 100644 --- a/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::{BufReadError, McBuf}; use azalea_buf::{McBufReadable, McBufWritable}; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; use uuid::Uuid; diff --git a/azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs index 32dafa27..aeaea223 100644 --- a/azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_mob_effect_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundUpdateMobEffectPacket { diff --git a/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs index b48877fd..33e8e0fe 100644 --- a/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs @@ -2,7 +2,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; use azalea_core::{ResourceLocation, Slot}; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs index f698a22b..8f5cd04e 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::{BufReadError, McBuf, McBufVarReadable, McBufVarWritable}; use azalea_buf::{McBufReadable, McBufWritable}; use azalea_core::ResourceLocation; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; use std::ops::Deref; use std::{ collections::HashMap, diff --git a/azalea-protocol/src/packets/game/clientbound_update_view_distance_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_view_distance_packet.rs index 69387b94..1d4a185e 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_view_distance_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_view_distance_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundGamePacket; +use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] pub struct ClientboundUpdateViewDistancePacket { diff --git a/azalea-protocol/src/packets/game/mod.rs b/azalea-protocol/src/packets/game/mod.rs index ca647241..ae66c0be 100644 --- a/azalea-protocol/src/packets/game/mod.rs +++ b/azalea-protocol/src/packets/game/mod.rs @@ -158,7 +158,7 @@ pub mod serverbound_teleport_to_entity_packet; pub mod serverbound_use_item_on_packet; pub mod serverbound_use_item_packet; -use packet_macros::declare_state_packets; +use azalea_protocol_macros::declare_state_packets; declare_state_packets!( GamePacket, diff --git a/azalea-protocol/src/packets/game/serverbound_accept_teleportation_packet.rs b/azalea-protocol/src/packets/game/serverbound_accept_teleportation_packet.rs index 8163916e..85311e48 100644 --- a/azalea-protocol/src/packets/game/serverbound_accept_teleportation_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_accept_teleportation_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundAcceptTeleportationPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_block_entity_tag_query.rs b/azalea-protocol/src/packets/game/serverbound_block_entity_tag_query.rs index 176df75e..dcd4d050 100644 --- a/azalea-protocol/src/packets/game/serverbound_block_entity_tag_query.rs +++ b/azalea-protocol/src/packets/game/serverbound_block_entity_tag_query.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundBlockEntityTagQuery { diff --git a/azalea-protocol/src/packets/game/serverbound_change_difficulty_packet.rs b/azalea-protocol/src/packets/game/serverbound_change_difficulty_packet.rs index 0414af46..16db0e09 100644 --- a/azalea-protocol/src/packets/game/serverbound_change_difficulty_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_change_difficulty_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::Difficulty; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundChangeDifficultyPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs index cfa9822f..19c51de8 100644 --- a/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_chat_ack_packet.rs @@ -1,6 +1,6 @@ use crate::packets::game::clientbound_player_chat_packet::LastSeenMessagesUpdate; use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundChatAckPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs index 02f8c64f..426ca882 100644 --- a/azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_chat_command_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_crypto::MessageSignature; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; use super::clientbound_player_chat_packet::LastSeenMessagesUpdate; diff --git a/azalea-protocol/src/packets/game/serverbound_chat_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_packet.rs index 7b397b6a..434474a2 100644 --- a/azalea-protocol/src/packets/game/serverbound_chat_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_chat_packet.rs @@ -1,7 +1,7 @@ use crate::packets::game::clientbound_player_chat_packet::LastSeenMessagesUpdate; use azalea_buf::McBuf; use azalea_crypto::MessageSignature; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundChatPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs index a3f1b7e5..50b44728 100644 --- a/azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_chat_preview_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundChatPreviewPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_client_command_packet.rs b/azalea-protocol/src/packets/game/serverbound_client_command_packet.rs index c1324256..2f360cb9 100644 --- a/azalea-protocol/src/packets/game/serverbound_client_command_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_client_command_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundClientCommandPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_client_information_packet.rs b/azalea-protocol/src/packets/game/serverbound_client_information_packet.rs index 1da0b917..c22df347 100644 --- a/azalea-protocol/src/packets/game/serverbound_client_information_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_client_information_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundClientInformationPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_command_suggestion_packet.rs b/azalea-protocol/src/packets/game/serverbound_command_suggestion_packet.rs index b0d7d8e3..0cca3ceb 100644 --- a/azalea-protocol/src/packets/game/serverbound_command_suggestion_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_command_suggestion_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundCommandSuggestionPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_container_button_click_packet.rs b/azalea-protocol/src/packets/game/serverbound_container_button_click_packet.rs index 08013ec5..739e7390 100644 --- a/azalea-protocol/src/packets/game/serverbound_container_button_click_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_container_button_click_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundContainerButtonClickPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_container_click_packet.rs b/azalea-protocol/src/packets/game/serverbound_container_click_packet.rs index 5c18b8cd..18e93443 100644 --- a/azalea-protocol/src/packets/game/serverbound_container_click_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_container_click_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::Slot; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; use std::collections::HashMap; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_container_close_packet.rs b/azalea-protocol/src/packets/game/serverbound_container_close_packet.rs index c9894144..dbaf59f3 100644 --- a/azalea-protocol/src/packets/game/serverbound_container_close_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_container_close_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundContainerClosePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_custom_payload_packet.rs b/azalea-protocol/src/packets/game/serverbound_custom_payload_packet.rs index 25a01816..e1800e42 100644 --- a/azalea-protocol/src/packets/game/serverbound_custom_payload_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_custom_payload_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::McBuf; use azalea_buf::UnsizedByteArray; use azalea_core::ResourceLocation; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundCustomPayloadPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_edit_book_packet.rs b/azalea-protocol/src/packets/game/serverbound_edit_book_packet.rs index b562cbaf..62d4b318 100644 --- a/azalea-protocol/src/packets/game/serverbound_edit_book_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_edit_book_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundEditBookPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_entity_tag_query.rs b/azalea-protocol/src/packets/game/serverbound_entity_tag_query.rs index b3e4014e..5b0c7db6 100644 --- a/azalea-protocol/src/packets/game/serverbound_entity_tag_query.rs +++ b/azalea-protocol/src/packets/game/serverbound_entity_tag_query.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundEntityTagQuery { diff --git a/azalea-protocol/src/packets/game/serverbound_interact_packet.rs b/azalea-protocol/src/packets/game/serverbound_interact_packet.rs index 7f54bd44..f40ce406 100644 --- a/azalea-protocol/src/packets/game/serverbound_interact_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_interact_packet.rs @@ -1,7 +1,7 @@ use crate::packets::BufReadError; use azalea_buf::{McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; use azalea_core::Vec3; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_jigsaw_generate_packet.rs b/azalea-protocol/src/packets/game/serverbound_jigsaw_generate_packet.rs index e0dba5fc..f3cab5d4 100644 --- a/azalea-protocol/src/packets/game/serverbound_jigsaw_generate_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_jigsaw_generate_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundJigsawGeneratePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_keep_alive_packet.rs b/azalea-protocol/src/packets/game/serverbound_keep_alive_packet.rs index 5d3f055e..7485e11e 100644 --- a/azalea-protocol/src/packets/game/serverbound_keep_alive_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_keep_alive_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundKeepAlivePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_lock_difficulty_packet.rs b/azalea-protocol/src/packets/game/serverbound_lock_difficulty_packet.rs index bbfd7891..3c54a16a 100644 --- a/azalea-protocol/src/packets/game/serverbound_lock_difficulty_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_lock_difficulty_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundLockDifficultyPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_pos_packet.rs b/azalea-protocol/src/packets/game/serverbound_move_player_pos_packet.rs index aac85d6b..4e3face4 100644 --- a/azalea-protocol/src/packets/game/serverbound_move_player_pos_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_move_player_pos_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerPosPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_pos_rot_packet.rs b/azalea-protocol/src/packets/game/serverbound_move_player_pos_rot_packet.rs index a1ee359f..0ab9c885 100644 --- a/azalea-protocol/src/packets/game/serverbound_move_player_pos_rot_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_move_player_pos_rot_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerPosRotPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_rot_packet.rs b/azalea-protocol/src/packets/game/serverbound_move_player_rot_packet.rs index 86a4669f..11a77e73 100644 --- a/azalea-protocol/src/packets/game/serverbound_move_player_rot_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_move_player_rot_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerRotPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_move_player_status_only_packet.rs b/azalea-protocol/src/packets/game/serverbound_move_player_status_only_packet.rs index 64ba93ae..fc91caca 100644 --- a/azalea-protocol/src/packets/game/serverbound_move_player_status_only_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_move_player_status_only_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundMovePlayerStatusOnlyPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_move_vehicle_packet.rs b/azalea-protocol/src/packets/game/serverbound_move_vehicle_packet.rs index 31b2647e..929ba798 100644 --- a/azalea-protocol/src/packets/game/serverbound_move_vehicle_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_move_vehicle_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundMoveVehiclePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_paddle_boat_packet.rs b/azalea-protocol/src/packets/game/serverbound_paddle_boat_packet.rs index 812895bc..2db9ef2e 100644 --- a/azalea-protocol/src/packets/game/serverbound_paddle_boat_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_paddle_boat_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundPaddleBoatPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_pick_item_packet.rs b/azalea-protocol/src/packets/game/serverbound_pick_item_packet.rs index 5db8e00b..508e710b 100644 --- a/azalea-protocol/src/packets/game/serverbound_pick_item_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_pick_item_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundPickItemPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_place_recipe_packet.rs b/azalea-protocol/src/packets/game/serverbound_place_recipe_packet.rs index 82576791..c7aa6fd4 100644 --- a/azalea-protocol/src/packets/game/serverbound_place_recipe_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_place_recipe_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::ResourceLocation; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundPlaceRecipePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_player_abilities_packet.rs b/azalea-protocol/src/packets/game/serverbound_player_abilities_packet.rs index 7ea43e88..3d9cd930 100644 --- a/azalea-protocol/src/packets/game/serverbound_player_abilities_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_player_abilities_packet.rs @@ -1,6 +1,6 @@ use crate::packets::BufReadError; use azalea_buf::{McBufReadable, McBufWritable}; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, ServerboundGamePacket)] pub struct ServerboundPlayerAbilitiesPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_player_action_packet.rs b/azalea-protocol/src/packets/game/serverbound_player_action_packet.rs index ac2910b1..7091f3c1 100644 --- a/azalea-protocol/src/packets/game/serverbound_player_action_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_player_action_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; use azalea_core::Direction; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundPlayerActionPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_player_command_packet.rs b/azalea-protocol/src/packets/game/serverbound_player_command_packet.rs index 20f80b4c..d7688092 100644 --- a/azalea-protocol/src/packets/game/serverbound_player_command_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_player_command_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundPlayerCommandPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_player_input_packet.rs b/azalea-protocol/src/packets/game/serverbound_player_input_packet.rs index b0906691..ab0a5df0 100644 --- a/azalea-protocol/src/packets/game/serverbound_player_input_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_player_input_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::BufReadError; use azalea_buf::{McBufReadable, McBufWritable}; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, ServerboundGamePacket)] pub struct ServerboundPlayerInputPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_pong_packet.rs b/azalea-protocol/src/packets/game/serverbound_pong_packet.rs index a2a4b32d..17f1ac81 100644 --- a/azalea-protocol/src/packets/game/serverbound_pong_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_pong_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundPongPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_recipe_book_change_settings_packet.rs b/azalea-protocol/src/packets/game/serverbound_recipe_book_change_settings_packet.rs index 9fd8eca5..6b3f015b 100644 --- a/azalea-protocol/src/packets/game/serverbound_recipe_book_change_settings_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_recipe_book_change_settings_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundRecipeBookChangeSettingsPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_recipe_book_seen_recipe_packet.rs b/azalea-protocol/src/packets/game/serverbound_recipe_book_seen_recipe_packet.rs index d70e80bb..e82462df 100644 --- a/azalea-protocol/src/packets/game/serverbound_recipe_book_seen_recipe_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_recipe_book_seen_recipe_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::ResourceLocation; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundRecipeBookSeenRecipePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_rename_item_packet.rs b/azalea-protocol/src/packets/game/serverbound_rename_item_packet.rs index 85792895..8308ac31 100644 --- a/azalea-protocol/src/packets/game/serverbound_rename_item_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_rename_item_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundRenameItemPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_resource_pack_packet.rs b/azalea-protocol/src/packets/game/serverbound_resource_pack_packet.rs index 98a1d3f7..104f8f73 100644 --- a/azalea-protocol/src/packets/game/serverbound_resource_pack_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_resource_pack_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundResourcePackPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_seen_advancements_packet.rs b/azalea-protocol/src/packets/game/serverbound_seen_advancements_packet.rs index 199568f7..82e90689 100644 --- a/azalea-protocol/src/packets/game/serverbound_seen_advancements_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_seen_advancements_packet.rs @@ -1,7 +1,7 @@ use crate::packets::BufReadError; use azalea_buf::{McBuf, McBufReadable, McBufWritable}; use azalea_core::ResourceLocation; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, ServerboundGamePacket)] pub struct ServerboundSeenAdvancementsPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_select_trade_packet.rs b/azalea-protocol/src/packets/game/serverbound_select_trade_packet.rs index 78e68bc0..b13e30d5 100644 --- a/azalea-protocol/src/packets/game/serverbound_select_trade_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_select_trade_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundSelectTradePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_set_beacon_packet.rs b/azalea-protocol/src/packets/game/serverbound_set_beacon_packet.rs index b286204c..db76cb9c 100644 --- a/azalea-protocol/src/packets/game/serverbound_set_beacon_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_beacon_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundSetBeaconPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_set_carried_item_packet.rs b/azalea-protocol/src/packets/game/serverbound_set_carried_item_packet.rs index 7a857794..044cdeb0 100644 --- a/azalea-protocol/src/packets/game/serverbound_set_carried_item_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_carried_item_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundSetCarriedItemPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_set_command_block_packet.rs b/azalea-protocol/src/packets/game/serverbound_set_command_block_packet.rs index 4569eb64..66bbb91a 100644 --- a/azalea-protocol/src/packets/game/serverbound_set_command_block_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_command_block_packet.rs @@ -1,7 +1,7 @@ use crate::packets::McBufWritable; use azalea_buf::{BufReadError, McBuf, McBufReadable}; use azalea_core::BlockPos; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, ServerboundGamePacket)] pub struct ServerboundSetCommandBlockPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_set_command_minecart_packet.rs b/azalea-protocol/src/packets/game/serverbound_set_command_minecart_packet.rs index 5d81b2b4..7756c924 100644 --- a/azalea-protocol/src/packets/game/serverbound_set_command_minecart_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_command_minecart_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundSetCommandMinecartPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_set_creative_mode_slot_packet.rs b/azalea-protocol/src/packets/game/serverbound_set_creative_mode_slot_packet.rs index 1e04a29e..254950de 100644 --- a/azalea-protocol/src/packets/game/serverbound_set_creative_mode_slot_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_creative_mode_slot_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::Slot; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundSetCreativeModeSlotPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_set_jigsaw_block_packet.rs b/azalea-protocol/src/packets/game/serverbound_set_jigsaw_block_packet.rs index d098aa86..94653bc7 100644 --- a/azalea-protocol/src/packets/game/serverbound_set_jigsaw_block_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_jigsaw_block_packet.rs @@ -4,7 +4,7 @@ use azalea_buf::McBuf; use azalea_buf::McBufReadable; use azalea_core::BlockPos; use azalea_core::ResourceLocation; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_set_structure_block_packet.rs b/azalea-protocol/src/packets/game/serverbound_set_structure_block_packet.rs index 33fbb951..0851857f 100644 --- a/azalea-protocol/src/packets/game/serverbound_set_structure_block_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_structure_block_packet.rs @@ -2,7 +2,7 @@ use crate::packets::BufReadError; use azalea_buf::McBuf; use azalea_buf::{McBufReadable, McBufWritable}; use azalea_core::BlockPos; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_sign_update_packet.rs b/azalea-protocol/src/packets/game/serverbound_sign_update_packet.rs index b90ef487..afebfa72 100644 --- a/azalea-protocol/src/packets/game/serverbound_sign_update_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_sign_update_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_core::BlockPos; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundSignUpdatePacket { diff --git a/azalea-protocol/src/packets/game/serverbound_swing_packet.rs b/azalea-protocol/src/packets/game/serverbound_swing_packet.rs index b22375d9..a3190843 100644 --- a/azalea-protocol/src/packets/game/serverbound_swing_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_swing_packet.rs @@ -1,6 +1,6 @@ use crate::packets::game::serverbound_interact_packet::InteractionHand; use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundSwingPacket { diff --git a/azalea-protocol/src/packets/game/serverbound_teleport_to_entity_packet.rs b/azalea-protocol/src/packets/game/serverbound_teleport_to_entity_packet.rs index 920b8cac..a7190ea5 100644 --- a/azalea-protocol/src/packets/game/serverbound_teleport_to_entity_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_teleport_to_entity_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; use uuid::Uuid; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_use_item_on_packet.rs b/azalea-protocol/src/packets/game/serverbound_use_item_on_packet.rs index 39762c2e..ab3fa137 100644 --- a/azalea-protocol/src/packets/game/serverbound_use_item_on_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_use_item_on_packet.rs @@ -1,7 +1,7 @@ use crate::packets::game::serverbound_interact_packet::InteractionHand; use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; use azalea_core::{BlockPos, Direction, Vec3}; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; use std::io::{Read, Write}; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_use_item_packet.rs b/azalea-protocol/src/packets/game/serverbound_use_item_packet.rs index 4fb9d34d..7fcab5dd 100644 --- a/azalea-protocol/src/packets/game/serverbound_use_item_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_use_item_packet.rs @@ -1,6 +1,6 @@ use crate::packets::game::serverbound_interact_packet::InteractionHand; use azalea_buf::McBuf; -use packet_macros::ServerboundGamePacket; +use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] pub struct ServerboundUseItemPacket { diff --git a/azalea-protocol/src/packets/handshake/client_intention_packet.rs b/azalea-protocol/src/packets/handshake/client_intention_packet.rs index ef47bba3..1900d476 100755 --- a/azalea-protocol/src/packets/handshake/client_intention_packet.rs +++ b/azalea-protocol/src/packets/handshake/client_intention_packet.rs @@ -1,6 +1,6 @@ use crate::packets::ConnectionProtocol; use azalea_buf::McBuf; -use packet_macros::ServerboundHandshakePacket; +use azalea_protocol_macros::ServerboundHandshakePacket; use std::hash::Hash; #[derive(Hash, Clone, Debug, McBuf, ServerboundHandshakePacket)] diff --git a/azalea-protocol/src/packets/handshake/mod.rs b/azalea-protocol/src/packets/handshake/mod.rs index 8fd12529..f2e8810e 100755 --- a/azalea-protocol/src/packets/handshake/mod.rs +++ b/azalea-protocol/src/packets/handshake/mod.rs @@ -1,6 +1,6 @@ pub mod client_intention_packet; -use packet_macros::declare_state_packets; +use azalea_protocol_macros::declare_state_packets; declare_state_packets!( HandshakePacket, diff --git a/azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs b/azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs index 515fb089..1a813ca8 100755 --- a/azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{McBuf, UnsizedByteArray}; use azalea_core::ResourceLocation; -use packet_macros::ClientboundLoginPacket; +use azalea_protocol_macros::ClientboundLoginPacket; use std::hash::Hash; #[derive(Hash, Clone, Debug, McBuf, ClientboundLoginPacket)] diff --git a/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs b/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs index 128d372b..2783159a 100755 --- a/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_game_profile_packet.rs @@ -1,6 +1,6 @@ use azalea_auth::game_profile::GameProfile; use azalea_buf::McBuf; -use packet_macros::ClientboundLoginPacket; +use azalea_protocol_macros::ClientboundLoginPacket; #[derive(Clone, Debug, McBuf, ClientboundLoginPacket)] pub struct ClientboundGameProfilePacket { diff --git a/azalea-protocol/src/packets/login/clientbound_hello_packet.rs b/azalea-protocol/src/packets/login/clientbound_hello_packet.rs index 06478691..0d5cce7d 100755 --- a/azalea-protocol/src/packets/login/clientbound_hello_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_hello_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundLoginPacket; +use azalea_protocol_macros::ClientboundLoginPacket; #[derive(Clone, Debug, McBuf, ClientboundLoginPacket)] pub struct ClientboundHelloPacket { diff --git a/azalea-protocol/src/packets/login/clientbound_login_disconnect_packet.rs b/azalea-protocol/src/packets/login/clientbound_login_disconnect_packet.rs index bfcddc69..2b8144ef 100644 --- a/azalea-protocol/src/packets/login/clientbound_login_disconnect_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_login_disconnect_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::component::Component; -use packet_macros::ClientboundLoginPacket; +use azalea_protocol_macros::ClientboundLoginPacket; #[derive(Clone, Debug, McBuf, ClientboundLoginPacket)] pub struct ClientboundLoginDisconnectPacket { diff --git a/azalea-protocol/src/packets/login/mod.rs b/azalea-protocol/src/packets/login/mod.rs index 17976e48..1186304a 100755 --- a/azalea-protocol/src/packets/login/mod.rs +++ b/azalea-protocol/src/packets/login/mod.rs @@ -7,7 +7,7 @@ pub mod serverbound_custom_query_packet; pub mod serverbound_hello_packet; pub mod serverbound_key_packet; -use packet_macros::declare_state_packets; +use azalea_protocol_macros::declare_state_packets; declare_state_packets!( LoginPacket, diff --git a/azalea-protocol/src/packets/login/serverbound_custom_query_packet.rs b/azalea-protocol/src/packets/login/serverbound_custom_query_packet.rs index cc9a5dc9..1d1885cf 100644 --- a/azalea-protocol/src/packets/login/serverbound_custom_query_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_custom_query_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::{McBuf, UnsizedByteArray}; -use packet_macros::ServerboundLoginPacket; +use azalea_protocol_macros::ServerboundLoginPacket; #[derive(Clone, Debug, McBuf, ServerboundLoginPacket)] pub struct ServerboundCustomQueryPacket { diff --git a/azalea-protocol/src/packets/login/serverbound_hello_packet.rs b/azalea-protocol/src/packets/login/serverbound_hello_packet.rs index a6443737..06cf1fa7 100755 --- a/azalea-protocol/src/packets/login/serverbound_hello_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_hello_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundLoginPacket; +use azalea_protocol_macros::ServerboundLoginPacket; use uuid::Uuid; #[derive(Clone, Debug, ServerboundLoginPacket, McBuf, PartialEq)] diff --git a/azalea-protocol/src/packets/login/serverbound_key_packet.rs b/azalea-protocol/src/packets/login/serverbound_key_packet.rs index 54f268e7..ba4bcb8a 100644 --- a/azalea-protocol/src/packets/login/serverbound_key_packet.rs +++ b/azalea-protocol/src/packets/login/serverbound_key_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBuf}; use azalea_crypto::SaltSignaturePair; -use packet_macros::ServerboundLoginPacket; +use azalea_protocol_macros::ServerboundLoginPacket; use std::io::{Read, Write}; use azalea_buf::{McBufReadable, McBufWritable}; diff --git a/azalea-protocol/src/packets/status/clientbound_pong_response_packet.rs b/azalea-protocol/src/packets/status/clientbound_pong_response_packet.rs index 08a086c5..8c8a7bb1 100644 --- a/azalea-protocol/src/packets/status/clientbound_pong_response_packet.rs +++ b/azalea-protocol/src/packets/status/clientbound_pong_response_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ClientboundStatusPacket; +use azalea_protocol_macros::ClientboundStatusPacket; #[derive(Clone, Debug, McBuf, ClientboundStatusPacket)] pub struct ClientboundPongResponsePacket { diff --git a/azalea-protocol/src/packets/status/mod.rs b/azalea-protocol/src/packets/status/mod.rs index 37c5af88..3c70c9b1 100755 --- a/azalea-protocol/src/packets/status/mod.rs +++ b/azalea-protocol/src/packets/status/mod.rs @@ -3,7 +3,7 @@ pub mod clientbound_status_response_packet; pub mod serverbound_ping_request_packet; pub mod serverbound_status_request_packet; -use packet_macros::declare_state_packets; +use azalea_protocol_macros::declare_state_packets; declare_state_packets!( StatusPacket, diff --git a/azalea-protocol/src/packets/status/serverbound_ping_request_packet.rs b/azalea-protocol/src/packets/status/serverbound_ping_request_packet.rs index 93f49644..c546081c 100644 --- a/azalea-protocol/src/packets/status/serverbound_ping_request_packet.rs +++ b/azalea-protocol/src/packets/status/serverbound_ping_request_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundStatusPacket; +use azalea_protocol_macros::ServerboundStatusPacket; #[derive(Clone, Debug, McBuf, ServerboundStatusPacket)] pub struct ServerboundPingRequestPacket { diff --git a/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs b/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs index 26885d6b..27fce3bf 100755 --- a/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs +++ b/azalea-protocol/src/packets/status/serverbound_status_request_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use packet_macros::ServerboundStatusPacket; +use azalea_protocol_macros::ServerboundStatusPacket; #[derive(Clone, Debug, McBuf, ServerboundStatusPacket)] pub struct ServerboundStatusRequestPacket {} diff --git a/azalea-registry/Cargo.toml b/azalea-registry/Cargo.toml index a2026bfb..c9a4ed02 100644 --- a/azalea-registry/Cargo.toml +++ b/azalea-registry/Cargo.toml @@ -1,9 +1,11 @@ [package] +description = "Use Minecraft's registries." edition = "2021" +license = "MIT" name = "azalea-registry" version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -registry-macros = {path = "./registry-macros"} +azalea-registry-macros = {path = "./azalea-registry-macros", version = "^0.1.0"} diff --git a/azalea-registry/azalea-registry-macros/Cargo.toml b/azalea-registry/azalea-registry-macros/Cargo.toml new file mode 100644 index 00000000..8db0e229 --- /dev/null +++ b/azalea-registry/azalea-registry-macros/Cargo.toml @@ -0,0 +1,16 @@ +[package] +description = "Macros internally used in azalea-registry." +edition = "2021" +license = "MIT" +name = "azalea-registry-macros" +version = "0.1.0" + +[lib] +proc-macro = true + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +proc-macro2 = "1.0.39" +quote = "1.0.18" +syn = "1.0.95" diff --git a/azalea-registry/azalea-registry-macros/src/lib.rs b/azalea-registry/azalea-registry-macros/src/lib.rs new file mode 100644 index 00000000..fef698f5 --- /dev/null +++ b/azalea-registry/azalea-registry-macros/src/lib.rs @@ -0,0 +1,131 @@ +use proc_macro::TokenStream; +use quote::quote; +use syn::{ + self, braced, + parse::{Parse, ParseStream, Result}, + parse_macro_input, + punctuated::Punctuated, + Ident, LitStr, Token, +}; + +struct RegistryItem { + name: Ident, + id: String, +} + +struct Registry { + name: Ident, + items: Vec, +} + +impl Parse for RegistryItem { + // Air => "minecraft:air" + fn parse(input: ParseStream) -> Result { + let name = input.parse()?; + input.parse::]>()?; + let id = input.parse::()?.value(); + Ok(RegistryItem { name, id }) + } +} + +impl Parse for Registry { + fn parse(input: ParseStream) -> Result { + // Block, { + // Air => "minecraft:air", + // Stone => "minecraft:stone" + // } + let name = input.parse()?; + let _ = input.parse::()?; + let content; + braced!(content in input); + let items: Punctuated = + content.parse_terminated(RegistryItem::parse)?; + + Ok(Registry { + name, + items: items.into_iter().collect(), + }) + } +} + +#[proc_macro] +pub fn registry(input: TokenStream) -> TokenStream { + let input = parse_macro_input!(input as Registry); + let name = input.name; + let mut generated = quote! {}; + + // enum Block { + // Air = 0, + // Stone, + // } + let mut enum_items = quote! {}; + for (i, item) in input.items.iter().enumerate() { + let name = &item.name; + let protocol_id = i as u32; + enum_items.extend(quote! { + #name = #protocol_id, + }); + } + generated.extend(quote! { + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] + #[repr(u32)] + pub enum #name { + #enum_items + } + }); + + let max_id = input.items.len() as u32; + generated.extend(quote! { + impl #name { + /// Transmutes a u32 to a #name. + /// + /// # Safety + /// The `id` should be at most #max_id. + #[inline] + pub unsafe fn from_u32_unchecked(id: u32) -> Self { + std::mem::transmute::(id) + } + + #[inline] + pub fn is_valid_id(id: u32) -> bool { + id <= #max_id + } + } + }); + + generated.extend(quote! { + impl TryFrom for #name { + type Error = (); + + /// Safely converts a state id to a block state. + fn try_from(id: u32) -> Result { + if Self::is_valid_id(id) { + Ok(unsafe { Self::from_u32_unchecked(id) }) + } else { + Err(()) + } + } + } + }); + + // Display that uses registry ids + let mut display_items = quote! {}; + for item in input.items.iter() { + let name = &item.name; + let id = &item.id; + display_items.extend(quote! { + Self::#name => write!(f, #id), + }); + } + generated.extend(quote! { + impl std::fmt::Display for #name { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + #display_items + } + } + } + }); + + generated.into() +} diff --git a/azalea-registry/registry-macros/Cargo.toml b/azalea-registry/registry-macros/Cargo.toml deleted file mode 100644 index f149430f..00000000 --- a/azalea-registry/registry-macros/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -edition = "2021" -name = "registry-macros" -version = "0.1.0" - -[lib] -proc-macro = true - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -proc-macro2 = "1.0.39" -quote = "1.0.18" -syn = "1.0.95" diff --git a/azalea-registry/registry-macros/src/lib.rs b/azalea-registry/registry-macros/src/lib.rs deleted file mode 100644 index fef698f5..00000000 --- a/azalea-registry/registry-macros/src/lib.rs +++ /dev/null @@ -1,131 +0,0 @@ -use proc_macro::TokenStream; -use quote::quote; -use syn::{ - self, braced, - parse::{Parse, ParseStream, Result}, - parse_macro_input, - punctuated::Punctuated, - Ident, LitStr, Token, -}; - -struct RegistryItem { - name: Ident, - id: String, -} - -struct Registry { - name: Ident, - items: Vec, -} - -impl Parse for RegistryItem { - // Air => "minecraft:air" - fn parse(input: ParseStream) -> Result { - let name = input.parse()?; - input.parse::]>()?; - let id = input.parse::()?.value(); - Ok(RegistryItem { name, id }) - } -} - -impl Parse for Registry { - fn parse(input: ParseStream) -> Result { - // Block, { - // Air => "minecraft:air", - // Stone => "minecraft:stone" - // } - let name = input.parse()?; - let _ = input.parse::()?; - let content; - braced!(content in input); - let items: Punctuated = - content.parse_terminated(RegistryItem::parse)?; - - Ok(Registry { - name, - items: items.into_iter().collect(), - }) - } -} - -#[proc_macro] -pub fn registry(input: TokenStream) -> TokenStream { - let input = parse_macro_input!(input as Registry); - let name = input.name; - let mut generated = quote! {}; - - // enum Block { - // Air = 0, - // Stone, - // } - let mut enum_items = quote! {}; - for (i, item) in input.items.iter().enumerate() { - let name = &item.name; - let protocol_id = i as u32; - enum_items.extend(quote! { - #name = #protocol_id, - }); - } - generated.extend(quote! { - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] - #[repr(u32)] - pub enum #name { - #enum_items - } - }); - - let max_id = input.items.len() as u32; - generated.extend(quote! { - impl #name { - /// Transmutes a u32 to a #name. - /// - /// # Safety - /// The `id` should be at most #max_id. - #[inline] - pub unsafe fn from_u32_unchecked(id: u32) -> Self { - std::mem::transmute::(id) - } - - #[inline] - pub fn is_valid_id(id: u32) -> bool { - id <= #max_id - } - } - }); - - generated.extend(quote! { - impl TryFrom for #name { - type Error = (); - - /// Safely converts a state id to a block state. - fn try_from(id: u32) -> Result { - if Self::is_valid_id(id) { - Ok(unsafe { Self::from_u32_unchecked(id) }) - } else { - Err(()) - } - } - } - }); - - // Display that uses registry ids - let mut display_items = quote! {}; - for item in input.items.iter() { - let name = &item.name; - let id = &item.id; - display_items.extend(quote! { - Self::#name => write!(f, #id), - }); - } - generated.extend(quote! { - impl std::fmt::Display for #name { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - #display_items - } - } - } - }); - - generated.into() -} diff --git a/azalea-registry/src/lib.rs b/azalea-registry/src/lib.rs index f7a8d61d..7434030b 100644 --- a/azalea-registry/src/lib.rs +++ b/azalea-registry/src/lib.rs @@ -1,4 +1,4 @@ -use registry_macros::registry; +use azalea_registry_macros::registry; registry!(Activity, { Core => "minecraft:core", diff --git a/azalea-world/Cargo.toml b/azalea-world/Cargo.toml index 8f88757d..96365653 100644 --- a/azalea-world/Cargo.toml +++ b/azalea-world/Cargo.toml @@ -1,16 +1,18 @@ [package] +description = "The Minecraft world representation used in Azalea." edition = "2021" +license = "MIT" name = "azalea-world" version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -azalea-block = {path = "../azalea-block", default-features = false} -azalea-buf = {path = "../azalea-buf"} -azalea-chat = {path = "../azalea-chat"} -azalea-core = {path = "../azalea-core"} -azalea-nbt = {path = "../azalea-nbt"} +azalea-block = {path = "../azalea-block", default-features = false, version = "^0.1.0"} +azalea-buf = {path = "../azalea-buf", version = "^0.1.0"} +azalea-chat = {path = "../azalea-chat", version = "^0.1.0"} +azalea-core = {path = "../azalea-core", version = "^0.1.0"} +azalea-nbt = {path = "../azalea-nbt", version = "^0.1.0"} log = "0.4.17" nohash-hasher = "0.2.0" thiserror = "1.0.34" diff --git a/codegen/lib/code/packet.py b/codegen/lib/code/packet.py index 692a449e..1d95ef71 100644 --- a/codegen/lib/code/packet.py +++ b/codegen/lib/code/packet.py @@ -33,7 +33,7 @@ def generate_packet(burger_packets, mappings: Mappings, target_packet_id, target generated_packet_code.append( f'#[derive(Clone, Debug, McBuf, {packet_derive_name})]') - uses.add(f'packet_macros::{packet_derive_name}') + uses.add(f'azalea_protocol_macros::{packet_derive_name}') uses.add(f'azalea_buf::McBuf') obfuscated_class_name = packet['class'].split('.')[0] diff --git a/codegen/lib/code/registry.py b/codegen/lib/code/registry.py index fbe9e5af..68d8c481 100644 --- a/codegen/lib/code/registry.py +++ b/codegen/lib/code/registry.py @@ -9,7 +9,7 @@ REGISTRIES_DIR = get_dir_location('../azalea-registry/src/lib.rs') def generate_registries(registries: dict): code = [] - code.append('use registry_macros::registry;') + code.append('use azalea_registry_macros::registry;') code.append('') for registry_name, registry in registries.items(): -- cgit v1.2.3