From 8b39cb4a783e3fc0fad49ddd213defb7a39b1468 Mon Sep 17 00:00:00 2001 From: theaddon Date: Sun, 1 Sep 2024 14:41:39 +0200 Subject: [PATCH] rename derive to macros --- Cargo.toml | 4 ++-- crates/proto/Cargo.toml | 2 +- crates/proto/src/connection.rs | 6 +++++- crates/proto/src/gamepackets.rs | 14 ++++++++------ crates/proto/src/packets/add_actor.rs | 2 +- crates/proto/src/packets/add_painting.rs | 2 +- crates/proto/src/packets/add_player.rs | 2 +- crates/proto/src/packets/animate_player.rs | 2 +- crates/proto/src/packets/boss_event.rs | 2 +- crates/proto/src/packets/camera.rs | 2 +- crates/proto/src/packets/change_dimension.rs | 2 +- crates/proto/src/packets/chunk_radius_request.rs | 2 +- crates/proto/src/packets/chunk_radius_updated.rs | 2 +- crates/proto/src/packets/client_cache_status.rs | 2 +- crates/proto/src/packets/command_request.rs | 2 +- crates/proto/src/packets/container_close.rs | 2 +- crates/proto/src/packets/container_open.rs | 2 +- .../src/packets/correct_player_move_prediction.rs | 2 +- crates/proto/src/packets/debug_info.rs | 2 +- crates/proto/src/packets/emote_list.rs | 2 +- .../src/packets/handshake_server_to_client.rs | 2 +- crates/proto/src/packets/interact.rs | 2 +- crates/proto/src/packets/inventory_content.rs | 2 +- crates/proto/src/packets/level_chunk.rs | 2 +- crates/proto/src/packets/login.rs | 2 +- crates/proto/src/packets/mob_equipment.rs | 2 +- crates/proto/src/packets/modal_form_request.rs | 2 +- crates/proto/src/packets/modal_form_response.rs | 2 +- crates/proto/src/packets/network_settings.rs | 2 +- .../proto/src/packets/network_settings_request.rs | 2 +- .../proto/src/packets/packet_violation_warning.rs | 2 +- crates/proto/src/packets/play_status.rs | 2 +- crates/proto/src/packets/player_action.rs | 2 +- crates/proto/src/packets/player_auth_input.rs | 2 +- crates/proto/src/packets/player_disconnect.rs | 2 +- crates/proto/src/packets/player_hotbar.rs | 2 +- crates/proto/src/packets/player_move.rs | 2 +- crates/proto/src/packets/player_transfer.rs | 2 +- crates/proto/src/packets/remove_actor.rs | 2 +- crates/proto/src/packets/resource_packs_info.rs | 2 +- .../proto/src/packets/resource_packs_response.rs | 2 +- crates/proto/src/packets/resource_packs_stack.rs | 2 +- crates/proto/src/packets/respawn.rs | 2 +- .../packets/server_player_post_move_position.rs | 2 +- .../proto/src/packets/server_settings_request.rs | 2 +- .../proto/src/packets/server_settings_response.rs | 2 +- crates/proto/src/packets/set_commands_enabled.rs | 2 +- crates/proto/src/packets/set_difficulty.rs | 2 +- .../src/packets/set_local_player_as_initialized.rs | 2 +- crates/proto/src/packets/set_player_gamemode.rs | 2 +- crates/proto/src/packets/set_time.rs | 2 +- crates/proto/src/packets/set_title.rs | 2 +- crates/proto/src/packets/show_credits.rs | 2 +- crates/proto/src/packets/show_profile.rs | 2 +- crates/proto/src/packets/start_game.rs | 2 +- crates/proto/src/packets/text_message.rs | 2 +- crates/proto/src/packets/toast_request.rs | 2 +- crates/proto/src/sub_client.rs | 14 +++++++------- crates/proto/src/types/ability_data.rs | 2 +- crates/proto/src/types/actor_link.rs | 2 +- crates/proto/src/types/actor_link_type.rs | 2 +- crates/proto/src/types/attribute.rs | 2 +- crates/proto/src/types/base_game_version.rs | 2 +- crates/proto/src/types/chat_restriction_level.rs | 2 +- crates/proto/src/types/chunk_pos.rs | 2 +- crates/proto/src/types/command_origin_data.rs | 2 +- crates/proto/src/types/container_id.rs | 2 +- crates/proto/src/types/container_type.rs | 2 +- crates/proto/src/types/credits_state.rs | 2 +- crates/proto/src/types/dataitem.rs | 2 +- crates/proto/src/types/disconnect_reason.rs | 2 +- crates/proto/src/types/edu_shared_uri_resource.rs | 2 +- crates/proto/src/types/event_type.rs | 2 +- crates/proto/src/types/experiments.rs | 2 +- crates/proto/src/types/gamerule.rs | 2 +- crates/proto/src/types/input_data.rs | 2 +- crates/proto/src/types/input_mode.rs | 2 +- crates/proto/src/types/interaction_model.rs | 2 +- .../proto/src/types/item_stack_net_id_variant.rs | 2 +- crates/proto/src/types/level_settings.rs | 2 +- crates/proto/src/types/modal_form_cancel_reason.rs | 2 +- crates/proto/src/types/network_block_pos.rs | 2 +- crates/proto/src/types/network_permissions.rs | 2 +- crates/proto/src/types/pack_info_behavior.rs | 2 +- crates/proto/src/types/pack_info_resource.rs | 2 +- crates/proto/src/types/play_mode.rs | 2 +- crates/proto/src/types/play_status.rs | 2 +- crates/proto/src/types/player_action_type.rs | 2 +- crates/proto/src/types/player_movement_mode.rs | 2 +- crates/proto/src/types/player_movement_settings.rs | 2 +- crates/proto/src/types/property_sync_data.rs | 2 +- .../src/types/resource_packs_response_status.rs | 2 +- .../proto/src/types/resource_packs_stack_pack.rs | 2 +- crates/proto/src/types/respawn_state.rs | 2 +- crates/proto/src/types/spawn_biome_type.rs | 2 +- crates/proto/src/types/spawn_settings.rs | 2 +- crates/proto/src/types/title_type.rs | 2 +- crates/proto_core/Cargo.toml | 2 +- crates/{proto_derive => proto_macros}/Cargo.toml | 2 +- crates/{proto_derive => proto_macros}/src/de.rs | 0 crates/{proto_derive => proto_macros}/src/lib.rs | 0 crates/{proto_derive => proto_macros}/src/ser.rs | 0 crates/shared/Cargo.toml | 2 +- crates/shared/src/world/difficulty.rs | 2 +- crates/shared/src/world/dimension.rs | 2 +- crates/shared/src/world/editor_world_type.rs | 2 +- crates/shared/src/world/gamemode.rs | 2 +- crates/shared/src/world/generator_type.rs | 2 +- crates/shared/src/world/permissions_level.rs | 2 +- 109 files changed, 124 insertions(+), 118 deletions(-) rename crates/{proto_derive => proto_macros}/Cargo.toml (84%) rename crates/{proto_derive => proto_macros}/src/de.rs (100%) rename crates/{proto_derive => proto_macros}/src/lib.rs (100%) rename crates/{proto_derive => proto_macros}/src/ser.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index af0acebb..b050de08 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ bedrockrs_nbt = { git = "https://github.com/bedrock-crustaceans/bedrockrs-nbt" } bedrockrs_proto = { path = "crates/proto", optional = true } bedrockrs_proto_core = { path = "crates/proto_core", optional = true } -bedrockrs_proto_derive = { path = "crates/proto_derive", optional = true } +bedrockrs_proto_macros = { path = "crates/proto_macros", optional = true } bedrockrs_addon = { path = "crates/addon", optional = true } @@ -27,5 +27,5 @@ bedrockrs_paletted_storage = { path = "crates/paletted_storage", optional = true full = ["addons", "proto", "world"] addons = ["dep:bedrockrs_addon"] -proto = ["dep:bedrockrs_proto", "dep:bedrockrs_proto_core", "dep:bedrockrs_proto_derive"] +proto = ["dep:bedrockrs_proto", "dep:bedrockrs_proto_core", "dep:bedrockrs_proto_macros"] world = ["dep:bedrockrs_world", "dep:bedrockrs_paletted_storage"] diff --git a/crates/proto/Cargo.toml b/crates/proto/Cargo.toml index 6b76bff6..b0a0cde0 100644 --- a/crates/proto/Cargo.toml +++ b/crates/proto/Cargo.toml @@ -8,7 +8,7 @@ bedrockrs_core = { path = "../core" } bedrockrs_shared = { path = "../shared" } bedrockrs_nbt = { git = "https://github.com/bedrock-crustaceans/bedrockrs-nbt" } bedrockrs_proto_core = { path = "../proto_core" } -bedrockrs_proto_derive = { path = "../proto_derive" } +bedrockrs_proto_macros = { path = "../proto_macros" } bedrockrs_addon = { path = "../addon" } thiserror = "1.0" diff --git a/crates/proto/src/connection.rs b/crates/proto/src/connection.rs index f314525e..815dd024 100644 --- a/crates/proto/src/connection.rs +++ b/crates/proto/src/connection.rs @@ -45,7 +45,11 @@ impl Connection { for game_packet in gamepackets { // Write gamepacket game_packet - .pk_serialize(&mut pk_stream, SubClientID::PrimaryClient, SubClientID::PrimaryClient) + .pk_serialize( + &mut pk_stream, + SubClientID::PrimaryClient, + SubClientID::PrimaryClient, + ) .map_err(ConnectionError::ProtoCodecError)? } diff --git a/crates/proto/src/gamepackets.rs b/crates/proto/src/gamepackets.rs index b21d1bcc..a09e9d7f 100644 --- a/crates/proto/src/gamepackets.rs +++ b/crates/proto/src/gamepackets.rs @@ -55,10 +55,10 @@ use crate::packets::show_profile::ShowProfilePacket; use crate::packets::start_game::StartGamePacket; use crate::packets::text_message::TextMessagePacket; use crate::packets::toast_request::ToastRequestPacket; +use crate::sub_client::SubClientID; use bedrockrs_core::int::VAR; use bedrockrs_proto_core::{error::ProtoCodecError, GamePacket, ProtoCodec}; -use bedrockrs_proto_derive::gamepackets; -use crate::sub_client::SubClientID; +use bedrockrs_proto_macros::gamepackets; gamepackets! { Login: LoginPacket, @@ -282,10 +282,12 @@ fn read_gamepacket_header( // Get the next 2 bits as the sub client sender id // Can never be more than an 8-bit integer due to being 2 bits big - let subclient_sender_id = SubClientID::proto_from((game_packet_header & 0b0000_1100_0000_0000 >> 10) as u8)?; + let subclient_sender_id = + SubClientID::proto_from((game_packet_header & 0b0000_1100_0000_0000 >> 10) as u8)?; // Get the next 2 bits as the sub client target id // Can never be more than an 8-bit integer due to being 2 bits big - let subclient_target_id = SubClientID::proto_from((game_packet_header & 0b0011_0000_0000_0000 >> 12) as u8)?; + let subclient_target_id = + SubClientID::proto_from((game_packet_header & 0b0011_0000_0000_0000 >> 12) as u8)?; Ok(( length, @@ -316,10 +318,10 @@ fn write_gamepacket_header( // Set the next 2 bits as the sub client sender id // Can never be more than an 8-bit integer due to being 2 bits big - game_packet_header |= subclient_sender_id as u16 >> 10 & 0b0000_1100_0000_0000; + game_packet_header |= subclient_sender_id.proto_to() as u16 >> 10 & 0b0000_1100_0000_0000; // Set the next 2 bits as the sub client target id // Can never be more than an 8-bit integer due to being 2 bits big - game_packet_header |= subclient_target_id as u16 >> 12 & 0b0011_0000_0000_0000; + game_packet_header |= subclient_target_id.proto_to() as u16 >> 12 & 0b0011_0000_0000_0000; // Write the gamepacket header VAR::::new(game_packet_header).proto_serialize(stream)?; diff --git a/crates/proto/src/packets/add_actor.rs b/crates/proto/src/packets/add_actor.rs index 01195f13..af70bc03 100644 --- a/crates/proto/src/packets/add_actor.rs +++ b/crates/proto/src/packets/add_actor.rs @@ -2,7 +2,7 @@ use bedrockrs_core::{ int::{LE, VAR}, Vec2, Vec3, }; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::{actor_runtime_id::ActorRuntimeID, actor_unique_id::ActorUniqueID}; use crate::types::{ diff --git a/crates/proto/src/packets/add_painting.rs b/crates/proto/src/packets/add_painting.rs index 15c5c588..896e1bf8 100644 --- a/crates/proto/src/packets/add_painting.rs +++ b/crates/proto/src/packets/add_painting.rs @@ -2,7 +2,7 @@ use bedrockrs_core::{ int::{LE, VAR}, Vec3, }; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::{actor_runtime_id::ActorRuntimeID, actor_unique_id::ActorUniqueID}; #[gamepacket(id = 22)] diff --git a/crates/proto/src/packets/add_player.rs b/crates/proto/src/packets/add_player.rs index 0ce1a50f..f4bda42b 100644 --- a/crates/proto/src/packets/add_player.rs +++ b/crates/proto/src/packets/add_player.rs @@ -4,7 +4,7 @@ use crate::types::network_item_stack_descriptor::NetworkItemStackDescriptor; use crate::types::property_sync_data::PropertySyncData; use bedrockrs_core::int::{LE, VAR}; use bedrockrs_core::Vec3; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; use bedrockrs_shared::world::gamemode::Gamemode; use uuid::Uuid; diff --git a/crates/proto/src/packets/animate_player.rs b/crates/proto/src/packets/animate_player.rs index a857395e..3b0aa06f 100644 --- a/crates/proto/src/packets/animate_player.rs +++ b/crates/proto/src/packets/animate_player.rs @@ -2,7 +2,7 @@ use crate::types::animate_action::AnimateAction; use bedrockrs_core::int::{LE, VAR}; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; use std::io::Cursor; diff --git a/crates/proto/src/packets/boss_event.rs b/crates/proto/src/packets/boss_event.rs index 26694aaa..1ed3b669 100644 --- a/crates/proto/src/packets/boss_event.rs +++ b/crates/proto/src/packets/boss_event.rs @@ -1,5 +1,5 @@ use crate::types::event_type::BossEventType; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_unique_id::ActorUniqueID; #[gamepacket(id = 74)] diff --git a/crates/proto/src/packets/camera.rs b/crates/proto/src/packets/camera.rs index 95204408..3ee1e268 100644 --- a/crates/proto/src/packets/camera.rs +++ b/crates/proto/src/packets/camera.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_unique_id::ActorUniqueID; #[gamepacket(id = 73)] diff --git a/crates/proto/src/packets/change_dimension.rs b/crates/proto/src/packets/change_dimension.rs index 8ea8ddde..7da197c7 100644 --- a/crates/proto/src/packets/change_dimension.rs +++ b/crates/proto/src/packets/change_dimension.rs @@ -1,6 +1,6 @@ use bedrockrs_core::int::LE; use bedrockrs_core::Vec3; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::world::dimension::Dimension; #[gamepacket(id = 61)] diff --git a/crates/proto/src/packets/chunk_radius_request.rs b/crates/proto/src/packets/chunk_radius_request.rs index fc8b3141..4befe61e 100644 --- a/crates/proto/src/packets/chunk_radius_request.rs +++ b/crates/proto/src/packets/chunk_radius_request.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 69)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/chunk_radius_updated.rs b/crates/proto/src/packets/chunk_radius_updated.rs index 35481c12..9da7ff2c 100644 --- a/crates/proto/src/packets/chunk_radius_updated.rs +++ b/crates/proto/src/packets/chunk_radius_updated.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::{LE, VAR}; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 70)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/client_cache_status.rs b/crates/proto/src/packets/client_cache_status.rs index 304877dd..668d694b 100644 --- a/crates/proto/src/packets/client_cache_status.rs +++ b/crates/proto/src/packets/client_cache_status.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 129)] #[derive(ProtoCodec, Debug, Copy, Clone)] diff --git a/crates/proto/src/packets/command_request.rs b/crates/proto/src/packets/command_request.rs index 8f370756..d227e89b 100644 --- a/crates/proto/src/packets/command_request.rs +++ b/crates/proto/src/packets/command_request.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::command_origin_data::CommandOriginData; diff --git a/crates/proto/src/packets/container_close.rs b/crates/proto/src/packets/container_close.rs index ca24876f..02b85dcb 100644 --- a/crates/proto/src/packets/container_close.rs +++ b/crates/proto/src/packets/container_close.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::container_type::ContainerType; diff --git a/crates/proto/src/packets/container_open.rs b/crates/proto/src/packets/container_open.rs index 0a808c4f..eb867a39 100644 --- a/crates/proto/src/packets/container_open.rs +++ b/crates/proto/src/packets/container_open.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_unique_id::ActorUniqueID; use crate::types::{ diff --git a/crates/proto/src/packets/correct_player_move_prediction.rs b/crates/proto/src/packets/correct_player_move_prediction.rs index fa1477d8..60f37922 100644 --- a/crates/proto/src/packets/correct_player_move_prediction.rs +++ b/crates/proto/src/packets/correct_player_move_prediction.rs @@ -1,5 +1,5 @@ use bedrockrs_core::{int::LE, Vec3}; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 161)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/debug_info.rs b/crates/proto/src/packets/debug_info.rs index fadd5e5c..bc7b6c6f 100644 --- a/crates/proto/src/packets/debug_info.rs +++ b/crates/proto/src/packets/debug_info.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_unique_id::ActorUniqueID; #[gamepacket(id = 155)] diff --git a/crates/proto/src/packets/emote_list.rs b/crates/proto/src/packets/emote_list.rs index 1c202a6f..64963fa9 100644 --- a/crates/proto/src/packets/emote_list.rs +++ b/crates/proto/src/packets/emote_list.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; use uuid::Uuid; diff --git a/crates/proto/src/packets/handshake_server_to_client.rs b/crates/proto/src/packets/handshake_server_to_client.rs index cf12490f..dd63c1c1 100644 --- a/crates/proto/src/packets/handshake_server_to_client.rs +++ b/crates/proto/src/packets/handshake_server_to_client.rs @@ -3,7 +3,7 @@ use std::io::Cursor; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; use serde_json::Value; #[gamepacket(id = 3)] diff --git a/crates/proto/src/packets/interact.rs b/crates/proto/src/packets/interact.rs index 402d995b..b1dd3380 100644 --- a/crates/proto/src/packets/interact.rs +++ b/crates/proto/src/packets/interact.rs @@ -3,7 +3,7 @@ use bedrockrs_core::int::LE; use bedrockrs_core::Vec3; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; use std::io::Cursor; diff --git a/crates/proto/src/packets/inventory_content.rs b/crates/proto/src/packets/inventory_content.rs index eeb8ab3b..e46f4042 100644 --- a/crates/proto/src/packets/inventory_content.rs +++ b/crates/proto/src/packets/inventory_content.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::network_item_stack_descriptor::NetworkItemStackDescriptor; diff --git a/crates/proto/src/packets/level_chunk.rs b/crates/proto/src/packets/level_chunk.rs index 82d00194..fec219ed 100644 --- a/crates/proto/src/packets/level_chunk.rs +++ b/crates/proto/src/packets/level_chunk.rs @@ -2,7 +2,7 @@ use crate::types::chunk_pos::ChunkPos; use bedrockrs_core::int::{LE, VAR}; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; #[gamepacket(id = 58)] #[derive(Debug, Clone)] diff --git a/crates/proto/src/packets/login.rs b/crates/proto/src/packets/login.rs index c85ba010..a7a3a1d0 100644 --- a/crates/proto/src/packets/login.rs +++ b/crates/proto/src/packets/login.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::BE; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::connection_request::ConnectionRequest; diff --git a/crates/proto/src/packets/mob_equipment.rs b/crates/proto/src/packets/mob_equipment.rs index e6d6b22b..3741f7bb 100644 --- a/crates/proto/src/packets/mob_equipment.rs +++ b/crates/proto/src/packets/mob_equipment.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::network_item_stack_descriptor::NetworkItemStackDescriptor; diff --git a/crates/proto/src/packets/modal_form_request.rs b/crates/proto/src/packets/modal_form_request.rs index 0d0476a5..4bcc5315 100644 --- a/crates/proto/src/packets/modal_form_request.rs +++ b/crates/proto/src/packets/modal_form_request.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 100)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/modal_form_response.rs b/crates/proto/src/packets/modal_form_response.rs index 99f79a19..2231ea62 100644 --- a/crates/proto/src/packets/modal_form_response.rs +++ b/crates/proto/src/packets/modal_form_response.rs @@ -1,6 +1,6 @@ use crate::types::modal_form_cancel_reason::ModalFormCancelReason; use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 101)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/network_settings.rs b/crates/proto/src/packets/network_settings.rs index 9854cc5a..3517c3fb 100644 --- a/crates/proto/src/packets/network_settings.rs +++ b/crates/proto/src/packets/network_settings.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::LE; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 143)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/network_settings_request.rs b/crates/proto/src/packets/network_settings_request.rs index 01084809..540d49bd 100644 --- a/crates/proto/src/packets/network_settings_request.rs +++ b/crates/proto/src/packets/network_settings_request.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::BE; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 193)] #[derive(ProtoCodec, Debug, Copy, Clone)] diff --git a/crates/proto/src/packets/packet_violation_warning.rs b/crates/proto/src/packets/packet_violation_warning.rs index 9c4957ee..8b40ad89 100644 --- a/crates/proto/src/packets/packet_violation_warning.rs +++ b/crates/proto/src/packets/packet_violation_warning.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 156)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/play_status.rs b/crates/proto/src/packets/play_status.rs index e3e12ab9..601d0a4a 100644 --- a/crates/proto/src/packets/play_status.rs +++ b/crates/proto/src/packets/play_status.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::play_status::PlayStatusType; diff --git a/crates/proto/src/packets/player_action.rs b/crates/proto/src/packets/player_action.rs index 6e5ef96b..e1011f75 100644 --- a/crates/proto/src/packets/player_action.rs +++ b/crates/proto/src/packets/player_action.rs @@ -1,6 +1,6 @@ use crate::types::{network_block_pos::NetworkBlockPos, player_action_type::PlayerActionType}; use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; #[gamepacket(id = 36)] diff --git a/crates/proto/src/packets/player_auth_input.rs b/crates/proto/src/packets/player_auth_input.rs index 025a6bcc..11e3b87c 100644 --- a/crates/proto/src/packets/player_auth_input.rs +++ b/crates/proto/src/packets/player_auth_input.rs @@ -6,7 +6,7 @@ use bedrockrs_core::int::{LE, VAR}; use bedrockrs_core::{Vec2, Vec3}; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; use bedrockrs_shared::actor_unique_id::ActorUniqueID; use std::io::Cursor; diff --git a/crates/proto/src/packets/player_disconnect.rs b/crates/proto/src/packets/player_disconnect.rs index ad7debb8..86762cb9 100644 --- a/crates/proto/src/packets/player_disconnect.rs +++ b/crates/proto/src/packets/player_disconnect.rs @@ -3,7 +3,7 @@ use std::io::Cursor; use crate::types::disconnect_reason::DisconnectReason; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; #[gamepacket(id = 5)] #[derive(Debug, Clone)] diff --git a/crates/proto/src/packets/player_hotbar.rs b/crates/proto/src/packets/player_hotbar.rs index 3fc638a6..7758fd86 100644 --- a/crates/proto/src/packets/player_hotbar.rs +++ b/crates/proto/src/packets/player_hotbar.rs @@ -1,7 +1,7 @@ use crate::types::container_id::ContainerID; use bedrockrs_core::int::VAR; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 48)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/player_move.rs b/crates/proto/src/packets/player_move.rs index 33403e13..f047c4b3 100644 --- a/crates/proto/src/packets/player_move.rs +++ b/crates/proto/src/packets/player_move.rs @@ -3,7 +3,7 @@ use bedrockrs_core::Vec2; use bedrockrs_core::Vec3; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; use std::io::Cursor; diff --git a/crates/proto/src/packets/player_transfer.rs b/crates/proto/src/packets/player_transfer.rs index 826dcbb4..37927dcb 100644 --- a/crates/proto/src/packets/player_transfer.rs +++ b/crates/proto/src/packets/player_transfer.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::LE; -use bedrockrs_proto_derive::{gamepacket, gamepackets, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, gamepackets, ProtoCodec}; #[gamepacket(id = 85)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/remove_actor.rs b/crates/proto/src/packets/remove_actor.rs index a23d7e82..680c7fe6 100644 --- a/crates/proto/src/packets/remove_actor.rs +++ b/crates/proto/src/packets/remove_actor.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_unique_id::ActorUniqueID; #[gamepacket(id = 14)] diff --git a/crates/proto/src/packets/resource_packs_info.rs b/crates/proto/src/packets/resource_packs_info.rs index 0aadd9e2..6e88f441 100644 --- a/crates/proto/src/packets/resource_packs_info.rs +++ b/crates/proto/src/packets/resource_packs_info.rs @@ -1,7 +1,7 @@ use bedrockrs_core::int::LE; use bedrockrs_core::int::VAR; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::pack_info_behavior::BehaviorPackInfoType; use crate::types::pack_info_resource::ResourcePackInfoType; diff --git a/crates/proto/src/packets/resource_packs_response.rs b/crates/proto/src/packets/resource_packs_response.rs index 04e2b3f9..c7478950 100644 --- a/crates/proto/src/packets/resource_packs_response.rs +++ b/crates/proto/src/packets/resource_packs_response.rs @@ -1,6 +1,6 @@ use bedrockrs_core::int::LE; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::resource_packs_response_status::ResourcePacksResponseStatus; diff --git a/crates/proto/src/packets/resource_packs_stack.rs b/crates/proto/src/packets/resource_packs_stack.rs index e315e7a7..aa72e243 100644 --- a/crates/proto/src/packets/resource_packs_stack.rs +++ b/crates/proto/src/packets/resource_packs_stack.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::base_game_version::BaseGameVersion; use crate::types::experiments::Experiments; diff --git a/crates/proto/src/packets/respawn.rs b/crates/proto/src/packets/respawn.rs index 900cf1c7..726915c1 100644 --- a/crates/proto/src/packets/respawn.rs +++ b/crates/proto/src/packets/respawn.rs @@ -1,7 +1,7 @@ use crate::types::respawn_state::RespawnState; use bedrockrs_core::int::LE; use bedrockrs_core::Vec3; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; #[gamepacket(id = 45)] diff --git a/crates/proto/src/packets/server_player_post_move_position.rs b/crates/proto/src/packets/server_player_post_move_position.rs index 01c634be..d80c0e09 100644 --- a/crates/proto/src/packets/server_player_post_move_position.rs +++ b/crates/proto/src/packets/server_player_post_move_position.rs @@ -1,5 +1,5 @@ use bedrockrs_core::{int::LE, Vec3}; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 18)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/server_settings_request.rs b/crates/proto/src/packets/server_settings_request.rs index 376a53a6..889c90bd 100644 --- a/crates/proto/src/packets/server_settings_request.rs +++ b/crates/proto/src/packets/server_settings_request.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 102)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/server_settings_response.rs b/crates/proto/src/packets/server_settings_response.rs index 3ea951d9..74efa42a 100644 --- a/crates/proto/src/packets/server_settings_response.rs +++ b/crates/proto/src/packets/server_settings_response.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 103)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/set_commands_enabled.rs b/crates/proto/src/packets/set_commands_enabled.rs index 1e51885e..97ecfcc3 100644 --- a/crates/proto/src/packets/set_commands_enabled.rs +++ b/crates/proto/src/packets/set_commands_enabled.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 59)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/set_difficulty.rs b/crates/proto/src/packets/set_difficulty.rs index cc4bafc4..031572fb 100644 --- a/crates/proto/src/packets/set_difficulty.rs +++ b/crates/proto/src/packets/set_difficulty.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::world::difficulty::Difficulty; #[gamepacket(id = 60)] diff --git a/crates/proto/src/packets/set_local_player_as_initialized.rs b/crates/proto/src/packets/set_local_player_as_initialized.rs index 34c9fb39..f811bdf6 100644 --- a/crates/proto/src/packets/set_local_player_as_initialized.rs +++ b/crates/proto/src/packets/set_local_player_as_initialized.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; #[gamepacket(id = 113)] diff --git a/crates/proto/src/packets/set_player_gamemode.rs b/crates/proto/src/packets/set_player_gamemode.rs index 5735caa5..98cf9a23 100644 --- a/crates/proto/src/packets/set_player_gamemode.rs +++ b/crates/proto/src/packets/set_player_gamemode.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::world::gamemode::Gamemode; #[gamepacket(id = 62)] diff --git a/crates/proto/src/packets/set_time.rs b/crates/proto/src/packets/set_time.rs index 35b4e008..d03f2382 100644 --- a/crates/proto/src/packets/set_time.rs +++ b/crates/proto/src/packets/set_time.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 10)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/set_title.rs b/crates/proto/src/packets/set_title.rs index 4419610b..ff43a3d4 100644 --- a/crates/proto/src/packets/set_title.rs +++ b/crates/proto/src/packets/set_title.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use crate::types::title_type::TitleType; diff --git a/crates/proto/src/packets/show_credits.rs b/crates/proto/src/packets/show_credits.rs index 43de68ba..e9018cd3 100644 --- a/crates/proto/src/packets/show_credits.rs +++ b/crates/proto/src/packets/show_credits.rs @@ -1,5 +1,5 @@ use crate::types::credits_state::CreditsState; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; #[gamepacket(id = 75)] diff --git a/crates/proto/src/packets/show_profile.rs b/crates/proto/src/packets/show_profile.rs index 79129a8f..a4cc5da9 100644 --- a/crates/proto/src/packets/show_profile.rs +++ b/crates/proto/src/packets/show_profile.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 104)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/packets/start_game.rs b/crates/proto/src/packets/start_game.rs index d8597c78..ba7e0bdd 100644 --- a/crates/proto/src/packets/start_game.rs +++ b/crates/proto/src/packets/start_game.rs @@ -1,7 +1,7 @@ use bedrockrs_core::int::{LE, VAR}; use bedrockrs_core::{Vec2, Vec3}; use bedrockrs_nbt as nbt; -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; use uuid::Uuid; use bedrockrs_shared::actor_runtime_id::ActorRuntimeID; diff --git a/crates/proto/src/packets/text_message.rs b/crates/proto/src/packets/text_message.rs index 2b922b75..5b14ac39 100644 --- a/crates/proto/src/packets/text_message.rs +++ b/crates/proto/src/packets/text_message.rs @@ -2,7 +2,7 @@ use crate::types::text_message_data::TextMessageData; use bedrockrs_core::int::VAR; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::gamepacket; +use bedrockrs_proto_macros::gamepacket; use std::io::Cursor; #[gamepacket(id = 9)] diff --git a/crates/proto/src/packets/toast_request.rs b/crates/proto/src/packets/toast_request.rs index f917a28d..b6714850 100644 --- a/crates/proto/src/packets/toast_request.rs +++ b/crates/proto/src/packets/toast_request.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::{gamepacket, ProtoCodec}; +use bedrockrs_proto_macros::{gamepacket, ProtoCodec}; #[gamepacket(id = 186)] #[derive(ProtoCodec, Debug, Clone)] diff --git a/crates/proto/src/sub_client.rs b/crates/proto/src/sub_client.rs index 5f743720..282d686b 100644 --- a/crates/proto/src/sub_client.rs +++ b/crates/proto/src/sub_client.rs @@ -1,6 +1,6 @@ -use bedrockrs_proto_derive::ProtoCodec; use bedrockrs_core::int::LE; use bedrockrs_proto_core::error::ProtoCodecError; +use bedrockrs_proto_macros::ProtoCodec; #[derive(Debug, Clone)] pub enum SubClientID { @@ -20,16 +20,16 @@ impl SubClientID { other => Err(ProtoCodecError::InvalidEnumID( format!("{other:?}"), String::from("SubClientID"), - )) + )), } } - + pub fn proto_to(&self) -> u8 { match self { - SubClientID::PrimaryClient => 0, - SubClientID::Client2 => 1, - SubClientID::Client3 => 2, - SubClientID::Client4 => 3, + SubClientID::PrimaryClient => 0, + SubClientID::Client2 => 1, + SubClientID::Client3 => 2, + SubClientID::Client4 => 3, } } } diff --git a/crates/proto/src/types/ability_data.rs b/crates/proto/src/types/ability_data.rs index 6524023b..17a6ae6f 100644 --- a/crates/proto/src/types/ability_data.rs +++ b/crates/proto/src/types/ability_data.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use bedrockrs_shared::actor_unique_id::ActorUniqueID; use bedrockrs_shared::world::permissions_level::PermissionLevel; diff --git a/crates/proto/src/types/actor_link.rs b/crates/proto/src/types/actor_link.rs index c3e29eb0..903ed2f3 100644 --- a/crates/proto/src/types/actor_link.rs +++ b/crates/proto/src/types/actor_link.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use bedrockrs_shared::actor_unique_id::ActorUniqueID; use super::actor_link_type::ActorLinkType; diff --git a/crates/proto/src/types/actor_link_type.rs b/crates/proto/src/types/actor_link_type.rs index 759895f3..90c516dd 100644 --- a/crates/proto/src/types/actor_link_type.rs +++ b/crates/proto/src/types/actor_link_type.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/attribute.rs b/crates/proto/src/types/attribute.rs index 625e3dc1..09a8e1b7 100644 --- a/crates/proto/src/types/attribute.rs +++ b/crates/proto/src/types/attribute.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::{LE, VAR}; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct Attribute { diff --git a/crates/proto/src/types/base_game_version.rs b/crates/proto/src/types/base_game_version.rs index 2bc8c70a..37d9505f 100644 --- a/crates/proto/src/types/base_game_version.rs +++ b/crates/proto/src/types/base_game_version.rs @@ -1,5 +1,5 @@ use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[repr(transparent)] diff --git a/crates/proto/src/types/chat_restriction_level.rs b/crates/proto/src/types/chat_restriction_level.rs index 40de2997..75f1e0e7 100644 --- a/crates/proto/src/types/chat_restriction_level.rs +++ b/crates/proto/src/types/chat_restriction_level.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::LE; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(LE::)] diff --git a/crates/proto/src/types/chunk_pos.rs b/crates/proto/src/types/chunk_pos.rs index 11f2e9c8..e72400b2 100644 --- a/crates/proto/src/types/chunk_pos.rs +++ b/crates/proto/src/types/chunk_pos.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::{LE, VAR}; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct ChunkPos { diff --git a/crates/proto/src/types/command_origin_data.rs b/crates/proto/src/types/command_origin_data.rs index 8edc29bd..adc07e7e 100644 --- a/crates/proto/src/types/command_origin_data.rs +++ b/crates/proto/src/types/command_origin_data.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use uuid::Uuid; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/container_id.rs b/crates/proto/src/types/container_id.rs index 04c675be..0478f42f 100644 --- a/crates/proto/src/types/container_id.rs +++ b/crates/proto/src/types/container_id.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::{BE, VAR}; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; /// Defines an enum for container IDs, used to identify different types of containers. #[derive(ProtoCodec, Debug, Copy, Clone, Eq, PartialEq)] diff --git a/crates/proto/src/types/container_type.rs b/crates/proto/src/types/container_type.rs index 21582a8c..d3d0a4a0 100644 --- a/crates/proto/src/types/container_type.rs +++ b/crates/proto/src/types/container_type.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::BE; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Copy, Clone, Eq, PartialEq)] #[enum_repr(BE::)] diff --git a/crates/proto/src/types/credits_state.rs b/crates/proto/src/types/credits_state.rs index 093ec251..48002c94 100644 --- a/crates/proto/src/types/credits_state.rs +++ b/crates/proto/src/types/credits_state.rs @@ -1,5 +1,5 @@ -use bedrockrs_proto_derive::ProtoCodec; use bedrockrs_core::int::VAR; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/dataitem.rs b/crates/proto/src/types/dataitem.rs index 32b63500..5d2efaa1 100644 --- a/crates/proto/src/types/dataitem.rs +++ b/crates/proto/src/types/dataitem.rs @@ -5,7 +5,7 @@ use bedrockrs_core::{ Vec3, }; use bedrockrs_nbt as nbt; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct DataItem { diff --git a/crates/proto/src/types/disconnect_reason.rs b/crates/proto/src/types/disconnect_reason.rs index d8bbfde5..66d083f5 100644 --- a/crates/proto/src/types/disconnect_reason.rs +++ b/crates/proto/src/types/disconnect_reason.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/edu_shared_uri_resource.rs b/crates/proto/src/types/edu_shared_uri_resource.rs index 76939f61..6c45b9a7 100644 --- a/crates/proto/src/types/edu_shared_uri_resource.rs +++ b/crates/proto/src/types/edu_shared_uri_resource.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct EduSharedResourceUri { diff --git a/crates/proto/src/types/event_type.rs b/crates/proto/src/types/event_type.rs index 3b7d5620..774c25d4 100644 --- a/crates/proto/src/types/event_type.rs +++ b/crates/proto/src/types/event_type.rs @@ -1,7 +1,7 @@ use bedrockrs_core::int::{LE, VAR}; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use bedrockrs_shared::actor_unique_id::ActorUniqueID; use std::io::Cursor; diff --git a/crates/proto/src/types/experiments.rs b/crates/proto/src/types/experiments.rs index 58e06da6..7d3f6503 100644 --- a/crates/proto/src/types/experiments.rs +++ b/crates/proto/src/types/experiments.rs @@ -1,6 +1,6 @@ use bedrockrs_core::int::LE; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct Experiments { diff --git a/crates/proto/src/types/gamerule.rs b/crates/proto/src/types/gamerule.rs index 8febfb8d..6b8a7c30 100644 --- a/crates/proto/src/types/gamerule.rs +++ b/crates/proto/src/types/gamerule.rs @@ -1,7 +1,7 @@ use bedrockrs_core::int::{LE, VAR}; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use std::io::Cursor; use std::sync::Arc; diff --git a/crates/proto/src/types/input_data.rs b/crates/proto/src/types/input_data.rs index 34e16214..dc75198d 100644 --- a/crates/proto/src/types/input_data.rs +++ b/crates/proto/src/types/input_data.rs @@ -1,7 +1,7 @@ use crate::types::inventory_transaction::UseItemTransactionData; use bedrockrs_core::int::{LE, VAR}; use bedrockrs_core::Vec2; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use bedrockrs_shared::actor_unique_id::ActorUniqueID; #[derive(Debug, Clone)] diff --git a/crates/proto/src/types/input_mode.rs b/crates/proto/src/types/input_mode.rs index e90e3c5a..c6c5d3ae 100644 --- a/crates/proto/src/types/input_mode.rs +++ b/crates/proto/src/types/input_mode.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/interaction_model.rs b/crates/proto/src/types/interaction_model.rs index db6fd391..52fb4761 100644 --- a/crates/proto/src/types/interaction_model.rs +++ b/crates/proto/src/types/interaction_model.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/item_stack_net_id_variant.rs b/crates/proto/src/types/item_stack_net_id_variant.rs index 8df5aa8b..f39bcb74 100644 --- a/crates/proto/src/types/item_stack_net_id_variant.rs +++ b/crates/proto/src/types/item_stack_net_id_variant.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct ItemStackNetIdVariant { pub raw_id: VAR, diff --git a/crates/proto/src/types/level_settings.rs b/crates/proto/src/types/level_settings.rs index 9c401d2d..f69844b7 100644 --- a/crates/proto/src/types/level_settings.rs +++ b/crates/proto/src/types/level_settings.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::{LE, VAR}; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use bedrockrs_shared::world::difficulty::Difficulty; use bedrockrs_shared::world::gamemode::Gamemode; diff --git a/crates/proto/src/types/modal_form_cancel_reason.rs b/crates/proto/src/types/modal_form_cancel_reason.rs index 227d1964..75809237 100644 --- a/crates/proto/src/types/modal_form_cancel_reason.rs +++ b/crates/proto/src/types/modal_form_cancel_reason.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::LE; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(LE::)] diff --git a/crates/proto/src/types/network_block_pos.rs b/crates/proto/src/types/network_block_pos.rs index 5e593449..361a92a9 100644 --- a/crates/proto/src/types/network_block_pos.rs +++ b/crates/proto/src/types/network_block_pos.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct NetworkBlockPos { diff --git a/crates/proto/src/types/network_permissions.rs b/crates/proto/src/types/network_permissions.rs index 45a87a27..60e9a53c 100644 --- a/crates/proto/src/types/network_permissions.rs +++ b/crates/proto/src/types/network_permissions.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct NetworkPermissions { diff --git a/crates/proto/src/types/pack_info_behavior.rs b/crates/proto/src/types/pack_info_behavior.rs index d3f68259..953e4d92 100644 --- a/crates/proto/src/types/pack_info_behavior.rs +++ b/crates/proto/src/types/pack_info_behavior.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::LE; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct BehaviorPackInfoType { diff --git a/crates/proto/src/types/pack_info_resource.rs b/crates/proto/src/types/pack_info_resource.rs index 5c83fe6c..1ae2bb7a 100644 --- a/crates/proto/src/types/pack_info_resource.rs +++ b/crates/proto/src/types/pack_info_resource.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::LE; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct ResourcePackInfoType { diff --git a/crates/proto/src/types/play_mode.rs b/crates/proto/src/types/play_mode.rs index b016b243..b9e008d1 100644 --- a/crates/proto/src/types/play_mode.rs +++ b/crates/proto/src/types/play_mode.rs @@ -1,6 +1,6 @@ use bedrockrs_core::int::{LE, VAR}; use bedrockrs_core::Vec3; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(Debug, Clone)] pub enum PlayMode { diff --git a/crates/proto/src/types/play_status.rs b/crates/proto/src/types/play_status.rs index cddbb4e6..12cb58d8 100644 --- a/crates/proto/src/types/play_status.rs +++ b/crates/proto/src/types/play_status.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::BE; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Copy, Clone, Eq, PartialEq)] #[enum_repr(BE::)] diff --git a/crates/proto/src/types/player_action_type.rs b/crates/proto/src/types/player_action_type.rs index b686d6fd..beeae950 100644 --- a/crates/proto/src/types/player_action_type.rs +++ b/crates/proto/src/types/player_action_type.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Copy, Clone, Eq, PartialEq)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/player_movement_mode.rs b/crates/proto/src/types/player_movement_mode.rs index be66605d..3430a037 100644 --- a/crates/proto/src/types/player_movement_mode.rs +++ b/crates/proto/src/types/player_movement_mode.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/proto/src/types/player_movement_settings.rs b/crates/proto/src/types/player_movement_settings.rs index 64bfc118..2da740c5 100644 --- a/crates/proto/src/types/player_movement_settings.rs +++ b/crates/proto/src/types/player_movement_settings.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use crate::types::player_movement_mode::PlayerMovementMode; diff --git a/crates/proto/src/types/property_sync_data.rs b/crates/proto/src/types/property_sync_data.rs index 8c5a0728..2780795d 100644 --- a/crates/proto/src/types/property_sync_data.rs +++ b/crates/proto/src/types/property_sync_data.rs @@ -6,7 +6,7 @@ pub struct PropertySyncData { pub float: FloatEntriesList, } -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct IntEntriesList { #[len_repr(VAR::)] diff --git a/crates/proto/src/types/resource_packs_response_status.rs b/crates/proto/src/types/resource_packs_response_status.rs index dd14ba66..c792008d 100644 --- a/crates/proto/src/types/resource_packs_response_status.rs +++ b/crates/proto/src/types/resource_packs_response_status.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::LE; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Copy, Clone, Eq, PartialEq)] #[enum_repr(LE::)] diff --git a/crates/proto/src/types/resource_packs_stack_pack.rs b/crates/proto/src/types/resource_packs_stack_pack.rs index 6e7b4a67..f86feaae 100644 --- a/crates/proto/src/types/resource_packs_stack_pack.rs +++ b/crates/proto/src/types/resource_packs_stack_pack.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] pub struct ResourcePacksStackPack { diff --git a/crates/proto/src/types/respawn_state.rs b/crates/proto/src/types/respawn_state.rs index 4aeedcad..b5d32817 100644 --- a/crates/proto/src/types/respawn_state.rs +++ b/crates/proto/src/types/respawn_state.rs @@ -1,5 +1,5 @@ -use bedrockrs_proto_derive::ProtoCodec; use bedrockrs_core::int::LE; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(LE::)] diff --git a/crates/proto/src/types/spawn_biome_type.rs b/crates/proto/src/types/spawn_biome_type.rs index 2bcb51ea..7db0b113 100644 --- a/crates/proto/src/types/spawn_biome_type.rs +++ b/crates/proto/src/types/spawn_biome_type.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use bedrockrs_core::int::LE; use bedrockrs_proto_core::error::ProtoCodecError; use bedrockrs_proto_core::ProtoCodec; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(LE::)] diff --git a/crates/proto/src/types/spawn_settings.rs b/crates/proto/src/types/spawn_settings.rs index 36332090..f97973a5 100644 --- a/crates/proto/src/types/spawn_settings.rs +++ b/crates/proto/src/types/spawn_settings.rs @@ -1,4 +1,4 @@ -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; use bedrockrs_shared::world::dimension::Dimension; diff --git a/crates/proto/src/types/title_type.rs b/crates/proto/src/types/title_type.rs index cdf7ab62..502dcf76 100644 --- a/crates/proto/src/types/title_type.rs +++ b/crates/proto/src/types/title_type.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Copy, Clone, Eq, PartialEq)] #[enum_repr(VAR::)] diff --git a/crates/proto_core/Cargo.toml b/crates/proto_core/Cargo.toml index acc3119c..9c1af3d1 100644 --- a/crates/proto_core/Cargo.toml +++ b/crates/proto_core/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] bedrockrs_core = { path = "../core" } bedrockrs_nbt = { git = "https://github.com/bedrock-crustaceans/bedrockrs-nbt" } -bedrockrs_proto_derive = { path = "../proto_derive" } +bedrockrs_proto_macros = { path = "../proto_macros" } thiserror = "1.0" serde_json = "1.0" diff --git a/crates/proto_derive/Cargo.toml b/crates/proto_macros/Cargo.toml similarity index 84% rename from crates/proto_derive/Cargo.toml rename to crates/proto_macros/Cargo.toml index 28fc928c..a57be7a8 100644 --- a/crates/proto_derive/Cargo.toml +++ b/crates/proto_macros/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "bedrockrs_proto_derive" +name = "bedrockrs_proto_macros" version = "0.1.0" edition = "2021" diff --git a/crates/proto_derive/src/de.rs b/crates/proto_macros/src/de.rs similarity index 100% rename from crates/proto_derive/src/de.rs rename to crates/proto_macros/src/de.rs diff --git a/crates/proto_derive/src/lib.rs b/crates/proto_macros/src/lib.rs similarity index 100% rename from crates/proto_derive/src/lib.rs rename to crates/proto_macros/src/lib.rs diff --git a/crates/proto_derive/src/ser.rs b/crates/proto_macros/src/ser.rs similarity index 100% rename from crates/proto_derive/src/ser.rs rename to crates/proto_macros/src/ser.rs diff --git a/crates/shared/Cargo.toml b/crates/shared/Cargo.toml index cce5eef4..52e66efc 100644 --- a/crates/shared/Cargo.toml +++ b/crates/shared/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" [dependencies] bedrockrs_core = { path = "../core" } bedrockrs_proto_core = { path = "../proto_core" } -bedrockrs_proto_derive = { path = "../proto_derive" } +bedrockrs_proto_macros = { path = "../proto_macros" } diff --git a/crates/shared/src/world/difficulty.rs b/crates/shared/src/world/difficulty.rs index dfb54a15..a38181db 100644 --- a/crates/shared/src/world/difficulty.rs +++ b/crates/shared/src/world/difficulty.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/shared/src/world/dimension.rs b/crates/shared/src/world/dimension.rs index 71941861..dcab69c4 100644 --- a/crates/shared/src/world/dimension.rs +++ b/crates/shared/src/world/dimension.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/shared/src/world/editor_world_type.rs b/crates/shared/src/world/editor_world_type.rs index 235360d7..33720da5 100644 --- a/crates/shared/src/world/editor_world_type.rs +++ b/crates/shared/src/world/editor_world_type.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/shared/src/world/gamemode.rs b/crates/shared/src/world/gamemode.rs index c74ea79a..4c48abe1 100644 --- a/crates/shared/src/world/gamemode.rs +++ b/crates/shared/src/world/gamemode.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/shared/src/world/generator_type.rs b/crates/shared/src/world/generator_type.rs index 3fe025b0..6e4c6fbb 100644 --- a/crates/shared/src/world/generator_type.rs +++ b/crates/shared/src/world/generator_type.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)] diff --git a/crates/shared/src/world/permissions_level.rs b/crates/shared/src/world/permissions_level.rs index 0a44bd0e..c44e1958 100644 --- a/crates/shared/src/world/permissions_level.rs +++ b/crates/shared/src/world/permissions_level.rs @@ -1,5 +1,5 @@ use bedrockrs_core::int::VAR; -use bedrockrs_proto_derive::ProtoCodec; +use bedrockrs_proto_macros::ProtoCodec; #[derive(ProtoCodec, Debug, Clone)] #[enum_repr(VAR::)]