From befa33a87950b6d0f3364cb4fe603f6d84bf4b8f Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 1 Oct 2023 15:19:13 -0500 Subject: [PATCH] organize azalea_core and re-export it from azalea --- azalea-client/src/attack.rs | 2 +- azalea-client/src/client.rs | 2 +- azalea-client/src/interact.rs | 7 ++- azalea-client/src/local_player.rs | 2 +- azalea-client/src/mining.rs | 2 +- azalea-client/src/packet_handling/game.rs | 6 ++- azalea-client/src/player.rs | 2 +- azalea-client/src/received_registries.rs | 2 +- azalea-core/src/aabb.rs | 9 ++-- azalea-core/src/block_hit_result.rs | 5 ++- azalea-core/src/cursor3d.rs | 2 +- azalea-core/src/delta.rs | 2 +- azalea-core/src/direction.rs | 2 +- azalea-core/src/lib.rs | 43 +++++-------------- azalea-core/src/math.rs | 2 + azalea-core/src/particle.rs | 2 +- azalea-core/src/position.rs | 8 +++- azalea-entity/src/data.rs | 6 ++- azalea-entity/src/dimensions.rs | 2 +- azalea-entity/src/lib.rs | 7 ++- azalea-entity/src/metadata.rs | 6 ++- azalea-entity/src/plugin/indexing.rs | 2 +- azalea-entity/src/plugin/mod.rs | 2 +- azalea-physics/src/clip.rs | 7 ++- .../src/collision/discrete_voxel_shape.rs | 6 ++- azalea-physics/src/collision/mergers.rs | 5 +-- azalea-physics/src/collision/mod.rs | 2 +- azalea-physics/src/collision/shape.rs | 5 ++- .../src/collision/world_collisions.rs | 6 ++- azalea-physics/src/lib.rs | 7 ++- azalea-protocol/src/packets/common.rs | 6 ++- .../clientbound_custom_payload_packet.rs | 2 +- .../clientbound_registry_data_packet.rs | 2 +- ...entbound_update_enabled_features_packet.rs | 2 +- .../clientbound_update_tags_packet.rs | 2 +- .../serverbound_client_information_packet.rs | 2 +- .../serverbound_custom_payload_packet.rs | 2 +- .../game/clientbound_add_entity_packet.rs | 2 +- .../clientbound_block_destruction_packet.rs | 2 +- .../clientbound_block_entity_data_packet.rs | 2 +- .../game/clientbound_block_event_packet.rs | 2 +- .../game/clientbound_block_update_packet.rs | 2 +- .../game/clientbound_boss_event_packet.rs | 2 +- .../clientbound_change_difficulty_packet.rs | 2 +- .../game/clientbound_chunks_biomes_packet.rs | 2 +- .../game/clientbound_commands_packet.rs | 2 +- .../game/clientbound_custom_payload_packet.rs | 2 +- .../game/clientbound_custom_sound_packet.rs | 2 +- .../game/clientbound_damage_event_packet.rs | 2 +- .../game/clientbound_explode_packet.rs | 2 +- .../clientbound_forget_level_chunk_packet.rs | 2 +- .../game/clientbound_level_event_packet.rs | 2 +- .../game/clientbound_light_update_packet.rs | 2 +- .../packets/game/clientbound_login_packet.rs | 2 +- .../clientbound_move_entity_pos_packet.rs | 2 +- .../clientbound_move_entity_pos_rot_packet.rs | 2 +- .../clientbound_open_sign_editor_packet.rs | 2 +- .../clientbound_place_ghost_recipe_packet.rs | 2 +- .../clientbound_player_abilities_packet.rs | 2 +- .../game/clientbound_player_chat_packet.rs | 2 +- .../clientbound_player_info_update_packet.rs | 2 +- .../clientbound_player_position_packet.rs | 2 +- .../packets/game/clientbound_recipe_packet.rs | 2 +- ...lientbound_section_blocks_update_packet.rs | 2 +- ...entbound_select_advancements_tab_packet.rs | 2 +- ...bound_set_default_spawn_position_packet.rs | 2 +- .../packets/game/clientbound_sound_packet.rs | 2 +- .../game/clientbound_stop_sound_packet.rs | 2 +- .../clientbound_teleport_entity_packet.rs | 2 +- .../clientbound_update_advancements_packet.rs | 4 +- .../clientbound_update_attributes_packet.rs | 2 +- ...entbound_update_enabled_features_packet.rs | 2 +- .../game/clientbound_update_recipes_packet.rs | 2 +- .../game/clientbound_update_tags_packet.rs | 2 +- .../serverbound_block_entity_tag_query.rs | 2 +- .../serverbound_change_difficulty_packet.rs | 2 +- .../packets/game/serverbound_chat_packet.rs | 2 +- .../game/serverbound_custom_payload_packet.rs | 2 +- .../game/serverbound_interact_packet.rs | 2 +- .../serverbound_jigsaw_generate_packet.rs | 2 +- .../game/serverbound_place_recipe_packet.rs | 2 +- .../serverbound_player_abilities_packet.rs | 2 +- .../game/serverbound_player_action_packet.rs | 4 +- .../game/serverbound_player_input_packet.rs | 2 +- ...verbound_recipe_book_seen_recipe_packet.rs | 2 +- .../serverbound_seen_advancements_packet.rs | 2 +- .../serverbound_set_command_block_packet.rs | 2 +- .../serverbound_set_jigsaw_block_packet.rs | 4 +- .../serverbound_set_structure_block_packet.rs | 2 +- .../game/serverbound_sign_update_packet.rs | 2 +- .../game/serverbound_use_item_on_packet.rs | 5 ++- .../login/clientbound_custom_query_packet.rs | 2 +- azalea-world/src/chunk_storage.rs | 2 +- azalea-world/src/container.rs | 2 +- azalea-world/src/heightmap.rs | 2 +- azalea-world/src/iterators.rs | 10 ++--- azalea-world/src/world.rs | 2 +- azalea/examples/testbot.rs | 2 +- azalea/src/bot.rs | 2 +- azalea/src/container.rs | 2 +- azalea/src/lib.rs | 7 ++- azalea/src/pathfinder/goals.rs | 2 +- azalea/src/pathfinder/mod.rs | 4 +- azalea/src/pathfinder/moves/basic.rs | 2 +- azalea/src/pathfinder/moves/mod.rs | 4 +- azalea/src/pathfinder/moves/parkour.rs | 2 +- azalea/src/pathfinder/simulation.rs | 2 +- codegen/lib/code/entity.py | 2 +- codegen/lib/code/utils.py | 6 +-- 109 files changed, 199 insertions(+), 156 deletions(-) diff --git a/azalea-client/src/attack.rs b/azalea-client/src/attack.rs index 45a4ccafb..ca2ff3120 100644 --- a/azalea-client/src/attack.rs +++ b/azalea-client/src/attack.rs @@ -1,4 +1,4 @@ -use azalea_core::GameMode; +use azalea_core::game_type::GameMode; use azalea_entity::{ metadata::{ShiftKeyDown, Sprinting}, update_bounding_box, Attributes, Physics, diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs index 6438cf06a..90d90e01a 100644 --- a/azalea-client/src/client.rs +++ b/azalea-client/src/client.rs @@ -23,7 +23,7 @@ use crate::{ use azalea_auth::{game_profile::GameProfile, sessionserver::ClientSessionServerError}; use azalea_buf::McBufWritable; use azalea_chat::FormattedText; -use azalea_core::{ResourceLocation, Vec3}; +use azalea_core::{position::Vec3, resource_location::ResourceLocation}; use azalea_entity::{ indexing::{EntityIdIndex, EntityUuidIndex}, metadata::Health, diff --git a/azalea-client/src/interact.rs b/azalea-client/src/interact.rs index dc1306e3c..b7b47ec66 100644 --- a/azalea-client/src/interact.rs +++ b/azalea-client/src/interact.rs @@ -1,7 +1,12 @@ use std::ops::AddAssign; use azalea_block::BlockState; -use azalea_core::{BlockHitResult, BlockPos, Direction, GameMode, Vec3}; +use azalea_core::{ + block_hit_result::BlockHitResult, + direction::Direction, + game_type::GameMode, + position::{BlockPos, Vec3}, +}; use azalea_entity::{ clamp_look_direction, view_vector, Attributes, EyeHeight, LocalEntity, LookDirection, Position, }; diff --git a/azalea-client/src/local_player.rs b/azalea-client/src/local_player.rs index 2989f36e9..22ea22324 100644 --- a/azalea-client/src/local_player.rs +++ b/azalea-client/src/local_player.rs @@ -1,7 +1,7 @@ use std::{collections::HashMap, io, sync::Arc}; use azalea_auth::game_profile::GameProfile; -use azalea_core::GameMode; +use azalea_core::game_type::GameMode; use azalea_entity::Dead; use azalea_protocol::packets::game::{ clientbound_player_abilities_packet::ClientboundPlayerAbilitiesPacket, ServerboundGamePacket, diff --git a/azalea-client/src/mining.rs b/azalea-client/src/mining.rs index 5db357b88..806a7b91d 100644 --- a/azalea-client/src/mining.rs +++ b/azalea-client/src/mining.rs @@ -1,5 +1,5 @@ use azalea_block::{Block, BlockState, FluidState}; -use azalea_core::{BlockPos, Direction, GameMode}; +use azalea_core::{direction::Direction, game_type::GameMode, position::BlockPos}; use azalea_entity::{mining::get_mine_progress, FluidOnEyes, Physics}; use azalea_inventory::ItemSlot; use azalea_physics::PhysicsSet; diff --git a/azalea-client/src/packet_handling/game.rs b/azalea-client/src/packet_handling/game.rs index c97c1a499..049eab03d 100644 --- a/azalea-client/src/packet_handling/game.rs +++ b/azalea-client/src/packet_handling/game.rs @@ -5,7 +5,11 @@ use std::{ }; use azalea_chat::FormattedText; -use azalea_core::{ChunkPos, GameMode, ResourceLocation, Vec3}; +use azalea_core::{ + game_type::GameMode, + position::{ChunkPos, Vec3}, + resource_location::ResourceLocation, +}; use azalea_entity::{ indexing::{EntityIdIndex, EntityUuidIndex}, metadata::{apply_metadata, Health, PlayerMetadataBundle}, diff --git a/azalea-client/src/player.rs b/azalea-client/src/player.rs index 1aba172a6..0a3f204f9 100755 --- a/azalea-client/src/player.rs +++ b/azalea-client/src/player.rs @@ -1,6 +1,6 @@ use azalea_auth::game_profile::GameProfile; use azalea_chat::FormattedText; -use azalea_core::GameMode; +use azalea_core::game_type::GameMode; use azalea_entity::indexing::EntityUuidIndex; use bevy_ecs::{ event::EventReader, diff --git a/azalea-client/src/received_registries.rs b/azalea-client/src/received_registries.rs index 024f52224..f959a5904 100644 --- a/azalea-client/src/received_registries.rs +++ b/azalea-client/src/received_registries.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_nbt::Nbt; use azalea_protocol::packets::configuration::clientbound_registry_data_packet::registry::{ DimensionTypeElement, RegistryType, diff --git a/azalea-core/src/aabb.rs b/azalea-core/src/aabb.rs index 7ad4a6576..61b015cb8 100755 --- a/azalea-core/src/aabb.rs +++ b/azalea-core/src/aabb.rs @@ -1,6 +1,9 @@ -use crate::{Axis, BlockHitResult, BlockPos, Direction, Vec3}; - -pub const EPSILON: f64 = 1.0E-7; +use crate::{ + block_hit_result::BlockHitResult, + direction::{Axis, Direction}, + math::EPSILON, + position::{BlockPos, Vec3}, +}; /// A rectangular prism with a starting and ending point. #[derive(Copy, Clone, Debug, PartialEq, Default)] diff --git a/azalea-core/src/block_hit_result.rs b/azalea-core/src/block_hit_result.rs index 3b4f72570..20cc723b3 100755 --- a/azalea-core/src/block_hit_result.rs +++ b/azalea-core/src/block_hit_result.rs @@ -1,4 +1,7 @@ -use crate::{BlockPos, Direction, Vec3}; +use crate::{ + direction::Direction, + position::{BlockPos, Vec3}, +}; #[derive(Debug, Clone, Copy, PartialEq)] pub struct BlockHitResult { diff --git a/azalea-core/src/cursor3d.rs b/azalea-core/src/cursor3d.rs index 180301e3b..0594a80a6 100755 --- a/azalea-core/src/cursor3d.rs +++ b/azalea-core/src/cursor3d.rs @@ -1,4 +1,4 @@ -use crate::BlockPos; +use crate::position::BlockPos; pub struct Cursor3d { index: usize, diff --git a/azalea-core/src/delta.rs b/azalea-core/src/delta.rs index 05bf662aa..646bcc955 100755 --- a/azalea-core/src/delta.rs +++ b/azalea-core/src/delta.rs @@ -1,4 +1,4 @@ -use crate::Vec3; +use crate::position::Vec3; pub use azalea_buf::McBuf; pub trait PositionDeltaTrait { diff --git a/azalea-core/src/direction.rs b/azalea-core/src/direction.rs index d3a0e4a97..32e1a23a7 100755 --- a/azalea-core/src/direction.rs +++ b/azalea-core/src/direction.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; -use crate::Vec3; +use crate::position::Vec3; #[derive(Clone, Copy, Debug, McBuf, Default, Eq, PartialEq)] pub enum Direction { diff --git a/azalea-core/src/lib.rs b/azalea-core/src/lib.rs index 6554d71db..2595471d6 100755 --- a/azalea-core/src/lib.rs +++ b/azalea-core/src/lib.rs @@ -5,37 +5,16 @@ #![allow(incomplete_features)] #![feature(generic_const_exprs)] -mod difficulty; -pub use difficulty::*; - -mod resource_location; -pub use resource_location::*; - -mod game_type; -pub use game_type::*; - -mod position; -pub use position::*; - -mod direction; -pub use direction::*; - -mod delta; -pub use delta::*; - -pub mod particle; - -mod cursor3d; -pub use cursor3d::*; - -mod bitset; -pub use bitset::*; - -mod aabb; -pub use aabb::*; - -mod block_hit_result; -pub use block_hit_result::*; - +pub mod aabb; +pub mod bitset; +pub mod block_hit_result; +pub mod cursor3d; +pub mod delta; +pub mod difficulty; +pub mod direction; +pub mod game_type; pub mod math; +pub mod particle; +pub mod position; +pub mod resource_location; pub mod tier; diff --git a/azalea-core/src/math.rs b/azalea-core/src/math.rs index 01695a0af..83e6020eb 100644 --- a/azalea-core/src/math.rs +++ b/azalea-core/src/math.rs @@ -1,5 +1,7 @@ use std::{f64::consts::PI, sync::LazyLock}; +pub const EPSILON: f64 = 1.0E-7; + pub static SIN: LazyLock<[f32; 65536]> = LazyLock::new(|| { let mut sin = [0.0; 65536]; for (i, item) in sin.iter_mut().enumerate() { diff --git a/azalea-core/src/particle.rs b/azalea-core/src/particle.rs index 60128f3f9..8e48255f7 100755 --- a/azalea-core/src/particle.rs +++ b/azalea-core/src/particle.rs @@ -1,4 +1,4 @@ -use crate::BlockPos; +use crate::position::BlockPos; use azalea_buf::McBuf; use azalea_inventory::ItemSlot; diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index f8072fa4b..09b105637 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -1,10 +1,16 @@ -use crate::ResourceLocation; +//! Representations of positions of various things in Minecraft. +//! +//! The most common ones are [`Vec3`] and [`BlockPos`], which are usually used +//! for entity positions and block positions, respectively. + use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; use std::{ io::{Cursor, Write}, ops::{Add, AddAssign, Mul, Rem, Sub}, }; +use crate::resource_location::ResourceLocation; + macro_rules! vec3_impl { ($name:ident, $type:ty) => { impl $name { diff --git a/azalea-entity/src/data.rs b/azalea-entity/src/data.rs index 9b210400b..54487ef11 100755 --- a/azalea-entity/src/data.rs +++ b/azalea-entity/src/data.rs @@ -4,7 +4,11 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; use azalea_chat::FormattedText; -use azalea_core::{particle::Particle, BlockPos, Direction, GlobalPos, Vec3}; +use azalea_core::{ + direction::Direction, + particle::Particle, + position::{BlockPos, GlobalPos, Vec3}, +}; use azalea_inventory::ItemSlot; use bevy_ecs::component::Component; use derive_more::Deref; diff --git a/azalea-entity/src/dimensions.rs b/azalea-entity/src/dimensions.rs index ab5a18085..b5a3f3103 100755 --- a/azalea-entity/src/dimensions.rs +++ b/azalea-entity/src/dimensions.rs @@ -1,4 +1,4 @@ -use azalea_core::{Vec3, AABB}; +use azalea_core::{aabb::AABB, position::Vec3}; #[derive(Debug, Default, Clone)] pub struct EntityDimensions { diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs index dbec425b6..45213fc16 100644 --- a/azalea-entity/src/lib.rs +++ b/azalea-entity/src/lib.rs @@ -12,7 +12,12 @@ mod plugin; use self::attributes::AttributeInstance; pub use attributes::Attributes; use azalea_block::BlockState; -use azalea_core::{math, BlockPos, ChunkPos, ResourceLocation, Vec3, AABB}; +use azalea_core::{ + aabb::AABB, + math, + position::{BlockPos, ChunkPos, Vec3}, + resource_location::ResourceLocation, +}; use azalea_world::{ChunkStorage, InstanceName}; use bevy_ecs::{bundle::Bundle, component::Component}; pub use data::*; diff --git a/azalea-entity/src/metadata.rs b/azalea-entity/src/metadata.rs index 8f63951f7..39ba9527c 100644 --- a/azalea-entity/src/metadata.rs +++ b/azalea-entity/src/metadata.rs @@ -8,7 +8,11 @@ use super::{ SnifferState, VillagerData, }; use azalea_chat::FormattedText; -use azalea_core::{particle::Particle, BlockPos, Direction, Vec3}; +use azalea_core::{ + direction::Direction, + particle::Particle, + position::{BlockPos, Vec3}, +}; use azalea_inventory::ItemSlot; use bevy_ecs::{bundle::Bundle, component::Component}; use derive_more::{Deref, DerefMut}; diff --git a/azalea-entity/src/plugin/indexing.rs b/azalea-entity/src/plugin/indexing.rs index f9c210a34..297949f6b 100644 --- a/azalea-entity/src/plugin/indexing.rs +++ b/azalea-entity/src/plugin/indexing.rs @@ -1,6 +1,6 @@ //! Stuff related to entity indexes and keeping track of entities in the world. -use azalea_core::ChunkPos; +use azalea_core::position::ChunkPos; use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId}; use bevy_ecs::{ component::Component, diff --git a/azalea-entity/src/plugin/mod.rs b/azalea-entity/src/plugin/mod.rs index 0e24a1a71..2e5a3244e 100644 --- a/azalea-entity/src/plugin/mod.rs +++ b/azalea-entity/src/plugin/mod.rs @@ -3,7 +3,7 @@ mod relative_updates; use std::collections::HashSet; -use azalea_core::{BlockPos, ChunkPos, Vec3}; +use azalea_core::position::{BlockPos, ChunkPos, Vec3}; use azalea_world::{InstanceContainer, InstanceName, MinecraftEntityId}; use bevy_app::{App, Plugin, PreUpdate, Update}; use bevy_ecs::prelude::*; diff --git a/azalea-physics/src/clip.rs b/azalea-physics/src/clip.rs index d6e0f6bb1..8c2d0c8fb 100644 --- a/azalea-physics/src/clip.rs +++ b/azalea-physics/src/clip.rs @@ -1,5 +1,10 @@ use azalea_block::BlockState; -use azalea_core::{math::lerp, BlockHitResult, BlockPos, Direction, Vec3, EPSILON}; +use azalea_core::{ + block_hit_result::BlockHitResult, + direction::Direction, + math::{lerp, EPSILON}, + position::{BlockPos, Vec3}, +}; use azalea_inventory::ItemSlot; use azalea_world::ChunkStorage; use bevy_ecs::entity::Entity; diff --git a/azalea-physics/src/collision/discrete_voxel_shape.rs b/azalea-physics/src/collision/discrete_voxel_shape.rs index 2bcd1f61a..f63b7c2af 100755 --- a/azalea-physics/src/collision/discrete_voxel_shape.rs +++ b/azalea-physics/src/collision/discrete_voxel_shape.rs @@ -1,5 +1,9 @@ +use azalea_core::{ + bitset::BitSet, + direction::{Axis, AxisCycle}, +}; + use super::mergers::IndexMerger; -use azalea_core::{Axis, AxisCycle, BitSet}; pub trait IntLineConsumer = FnMut(u32, u32, u32, u32, u32, u32); diff --git a/azalea-physics/src/collision/mergers.rs b/azalea-physics/src/collision/mergers.rs index e2381c497..7bb472a12 100755 --- a/azalea-physics/src/collision/mergers.rs +++ b/azalea-physics/src/collision/mergers.rs @@ -1,10 +1,7 @@ use std::{cmp::Ordering, convert::TryInto}; use super::CubePointRange; -use azalea_core::{ - math::{gcd, lcm}, - EPSILON, -}; +use azalea_core::math::{gcd, lcm, EPSILON}; #[derive(Debug)] pub enum IndexMerger { diff --git a/azalea-physics/src/collision/mod.rs b/azalea-physics/src/collision/mod.rs index 53ade2b26..1a8f44414 100644 --- a/azalea-physics/src/collision/mod.rs +++ b/azalea-physics/src/collision/mod.rs @@ -6,7 +6,7 @@ mod world_collisions; use std::ops::Add; -use azalea_core::{Axis, Vec3, AABB, EPSILON}; +use azalea_core::{aabb::AABB, direction::Axis, math::EPSILON, position::Vec3}; use azalea_world::{Instance, MoveEntityError}; use bevy_ecs::world::Mut; pub use blocks::BlockWithShape; diff --git a/azalea-physics/src/collision/shape.rs b/azalea-physics/src/collision/shape.rs index a39a86cf7..156f58695 100755 --- a/azalea-physics/src/collision/shape.rs +++ b/azalea-physics/src/collision/shape.rs @@ -1,7 +1,10 @@ use super::mergers::IndexMerger; use crate::collision::{BitSetDiscreteVoxelShape, DiscreteVoxelShape, AABB}; use azalea_core::{ - math::binary_search, Axis, AxisCycle, BlockHitResult, BlockPos, Direction, Vec3, EPSILON, + block_hit_result::BlockHitResult, + direction::{Axis, AxisCycle, Direction}, + math::{binary_search, EPSILON}, + position::{BlockPos, Vec3}, }; use std::{cmp, num::NonZeroU32}; diff --git a/azalea-physics/src/collision/world_collisions.rs b/azalea-physics/src/collision/world_collisions.rs index 414b4c58c..f5d1b650c 100644 --- a/azalea-physics/src/collision/world_collisions.rs +++ b/azalea-physics/src/collision/world_collisions.rs @@ -1,7 +1,11 @@ use super::Shapes; use crate::collision::{BlockWithShape, VoxelShape, AABB}; use azalea_block::BlockState; -use azalea_core::{ChunkPos, ChunkSectionPos, Cursor3d, CursorIterationType, EPSILON}; +use azalea_core::{ + cursor3d::{Cursor3d, CursorIterationType}, + math::EPSILON, + position::{ChunkPos, ChunkSectionPos}, +}; use azalea_world::{Chunk, Instance}; use parking_lot::RwLock; use std::sync::Arc; diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs index 5fe7d218d..53818ed3f 100644 --- a/azalea-physics/src/lib.rs +++ b/azalea-physics/src/lib.rs @@ -5,7 +5,10 @@ pub mod clip; pub mod collision; use azalea_block::{Block, BlockState}; -use azalea_core::{math, BlockPos, Vec3}; +use azalea_core::{ + math, + position::{BlockPos, Vec3}, +}; use azalea_entity::{ metadata::Sprinting, move_relative, Attributes, InLoadedChunk, Jumping, LocalEntity, LookDirection, Physics, Position, @@ -334,7 +337,7 @@ mod tests { use std::time::Duration; use super::*; - use azalea_core::{ChunkPos, ResourceLocation}; + use azalea_core::{position::ChunkPos, resource_location::ResourceLocation}; use azalea_entity::{EntityBundle, EntityPlugin}; use azalea_world::{Chunk, MinecraftEntityId, PartialInstance}; use bevy_app::App; diff --git a/azalea-protocol/src/packets/common.rs b/azalea-protocol/src/packets/common.rs index 0fa7cb1fc..8ad0b753d 100644 --- a/azalea-protocol/src/packets/common.rs +++ b/azalea-protocol/src/packets/common.rs @@ -1,5 +1,9 @@ use azalea_buf::McBuf; -use azalea_core::{GameMode, GlobalPos, OptionalGameType, ResourceLocation}; +use azalea_core::{ + game_type::{GameMode, OptionalGameType}, + position::GlobalPos, + resource_location::ResourceLocation, +}; #[derive(Clone, Debug, McBuf)] pub struct CommonPlayerSpawnInfo { diff --git a/azalea-protocol/src/packets/configuration/clientbound_custom_payload_packet.rs b/azalea-protocol/src/packets/configuration/clientbound_custom_payload_packet.rs index 0b0ea902d..701a317c4 100644 --- a/azalea-protocol/src/packets/configuration/clientbound_custom_payload_packet.rs +++ b/azalea-protocol/src/packets/configuration/clientbound_custom_payload_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_buf::UnsizedByteArray; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigurationPacket; #[derive(Clone, Debug, McBuf, ClientboundConfigurationPacket)] diff --git a/azalea-protocol/src/packets/configuration/clientbound_registry_data_packet.rs b/azalea-protocol/src/packets/configuration/clientbound_registry_data_packet.rs index 85345a1e0..08a1e880c 100644 --- a/azalea-protocol/src/packets/configuration/clientbound_registry_data_packet.rs +++ b/azalea-protocol/src/packets/configuration/clientbound_registry_data_packet.rs @@ -18,7 +18,7 @@ pub mod registry { //! biomes. use azalea_buf::{BufReadError, McBufReadable, McBufWritable}; - use azalea_core::ResourceLocation; + use azalea_core::resource_location::ResourceLocation; use azalea_nbt::Nbt; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use std::{collections::HashMap, io::Cursor}; diff --git a/azalea-protocol/src/packets/configuration/clientbound_update_enabled_features_packet.rs b/azalea-protocol/src/packets/configuration/clientbound_update_enabled_features_packet.rs index 5eedabc1e..ec37c8f30 100644 --- a/azalea-protocol/src/packets/configuration/clientbound_update_enabled_features_packet.rs +++ b/azalea-protocol/src/packets/configuration/clientbound_update_enabled_features_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigurationPacket; #[derive(Clone, Debug, McBuf, ClientboundConfigurationPacket)] diff --git a/azalea-protocol/src/packets/configuration/clientbound_update_tags_packet.rs b/azalea-protocol/src/packets/configuration/clientbound_update_tags_packet.rs index 215c94398..8ef42a76b 100644 --- a/azalea-protocol/src/packets/configuration/clientbound_update_tags_packet.rs +++ b/azalea-protocol/src/packets/configuration/clientbound_update_tags_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBuf, McBufVarReadable, McBufVarWritable}; use azalea_buf::{McBufReadable, McBufWritable}; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundConfigurationPacket; use std::io::Cursor; use std::ops::Deref; diff --git a/azalea-protocol/src/packets/configuration/serverbound_client_information_packet.rs b/azalea-protocol/src/packets/configuration/serverbound_client_information_packet.rs index 2af70b83d..fb980a46e 100644 --- a/azalea-protocol/src/packets/configuration/serverbound_client_information_packet.rs +++ b/azalea-protocol/src/packets/configuration/serverbound_client_information_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::{McBuf, McBufReadable, McBufWritable}; -use azalea_core::FixedBitSet; +use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ServerboundConfigurationPacket; use bevy_ecs::component::Component; diff --git a/azalea-protocol/src/packets/configuration/serverbound_custom_payload_packet.rs b/azalea-protocol/src/packets/configuration/serverbound_custom_payload_packet.rs index 589256bd7..48c977b17 100644 --- a/azalea-protocol/src/packets/configuration/serverbound_custom_payload_packet.rs +++ b/azalea-protocol/src/packets/configuration/serverbound_custom_payload_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_buf::UnsizedByteArray; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundConfigurationPacket; #[derive(Clone, Debug, McBuf, ServerboundConfigurationPacket)] 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 0f2686e60..59676fe5d 100755 --- a/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_add_entity_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::{ResourceLocation, Vec3}; +use azalea_core::{position::Vec3, resource_location::ResourceLocation}; use azalea_entity::{metadata::apply_default_metadata, EntityBundle}; use azalea_protocol_macros::ClientboundGamePacket; use uuid::Uuid; 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 18021a518..130c698e6 100755 --- a/azalea-protocol/src/packets/game/clientbound_block_destruction_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_destruction_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 fda1bd437..f9c889f82 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 dbc04cc21..86f57b973 100755 --- a/azalea-protocol/src/packets/game/clientbound_block_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_block_event_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::Block; 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 3034accc1..c1869e740 100755 --- 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_block::BlockState; use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 e73b55bae..d28b1e61c 100755 --- a/azalea-protocol/src/packets/game/clientbound_boss_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_boss_event_packet.rs @@ -2,7 +2,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; use azalea_chat::FormattedText; -use azalea_core::FixedBitSet; +use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ClientboundGamePacket; use std::io::Cursor; use std::io::Write; 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 4a956901e..e7dafbeb6 100755 --- a/azalea-protocol/src/packets/game/clientbound_change_difficulty_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_change_difficulty_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::Difficulty; +use azalea_core::difficulty::Difficulty; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_chunks_biomes_packet.rs b/azalea-protocol/src/packets/game/clientbound_chunks_biomes_packet.rs index 68b40b5d5..7c8f21543 100644 --- a/azalea-protocol/src/packets/game/clientbound_chunks_biomes_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_chunks_biomes_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ChunkPos; +use azalea_core::position::ChunkPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs index 54bf0b7d0..0b14fbd12 100755 --- a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; -use azalea_core::{FixedBitSet, ResourceLocation}; +use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation}; use azalea_protocol_macros::ClientboundGamePacket; use log::warn; use std::io::{Cursor, Write}; 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 e5ad6af0a..fb5f11ba5 100755 --- a/azalea-protocol/src/packets/game/clientbound_custom_payload_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_custom_payload_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_buf::UnsizedByteArray; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 9cc348b25..05b1560b6 100644 --- a/azalea-protocol/src/packets/game/clientbound_custom_sound_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_custom_sound_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_damage_event_packet.rs b/azalea-protocol/src/packets/game/clientbound_damage_event_packet.rs index 941ed01f4..cf5d369ac 100644 --- a/azalea-protocol/src/packets/game/clientbound_damage_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_damage_event_packet.rs @@ -1,7 +1,7 @@ use std::io::{Cursor, Write}; use azalea_buf::{McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; -use azalea_core::Vec3; +use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs index 2146a2544..720f06a43 100755 --- a/azalea-protocol/src/packets/game/clientbound_explode_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_explode_packet.rs @@ -1,7 +1,7 @@ use std::io::{Cursor, Write}; use azalea_buf::{BufReadError, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; #[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 524afd088..027d41ee3 100755 --- 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 azalea_core::ChunkPos; +use azalea_core::position::ChunkPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 6dbefb384..a79217f19 100755 --- a/azalea-protocol/src/packets/game/clientbound_level_event_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_level_event_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, 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 3e5ca1b99..8d50e94d1 100755 --- a/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_light_update_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BitSet; +use azalea_core::bitset::BitSet; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_login_packet.rs b/azalea-protocol/src/packets/game/clientbound_login_packet.rs index b6054a759..1b70cbb9b 100755 --- a/azalea-protocol/src/packets/game/clientbound_login_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_login_packet.rs @@ -1,7 +1,7 @@ use crate::packets::common::CommonPlayerSpawnInfo; use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; /// The first packet sent by the server to the client after login. 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 593234a17..d909fdcc5 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::PositionDelta8; +use azalea_core::delta::PositionDelta8; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 ff274bd9f..5a5dfbd32 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::PositionDelta8; +use azalea_core::delta::PositionDelta8; use azalea_protocol_macros::ClientboundGamePacket; /// This packet is sent by the server when an entity moves less then 8 blocks. 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 c774b6475..0b03cbe25 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 8951fa3e4..4d61a526c 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 12fd45e86..edb5f949f 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 azalea_core::FixedBitSet; +use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Cursor, Write}; 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 6ce86ea4c..6a80e1727 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_chat_packet.rs @@ -5,7 +5,7 @@ use azalea_chat::{ translatable_component::{StringOrComponent, TranslatableComponent}, FormattedText, }; -use azalea_core::BitSet; +use azalea_core::bitset::BitSet; use azalea_crypto::MessageSignature; use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Cursor, Write}; diff --git a/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs b/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs index 1dad147f8..5d54cce2f 100644 --- a/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_info_update_packet.rs @@ -3,7 +3,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; use azalea_chat::FormattedText; -use azalea_core::{FixedBitSet, GameMode}; +use azalea_core::{bitset::FixedBitSet, game_type::GameMode}; use azalea_protocol_macros::ClientboundGamePacket; use std::{ collections::HashMap, 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 f59d20ac4..d63108da0 100755 --- a/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_player_position_packet.rs @@ -1,7 +1,7 @@ use std::io::{Cursor, Write}; use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; -use azalea_core::FixedBitSet; +use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ClientboundGamePacket; #[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 b6ac6f3b7..e948e53c1 100755 --- a/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_recipe_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Cursor, Write}; 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 aeec52fc6..e92ca422d 100755 --- a/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_section_blocks_update_packet.rs @@ -4,7 +4,7 @@ use azalea_block::BlockState; use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; -use azalea_core::{ChunkSectionBlockPos, ChunkSectionPos}; +use azalea_core::position::{ChunkSectionBlockPos, ChunkSectionPos}; use azalea_protocol_macros::ClientboundGamePacket; #[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 eee48df80..c0d5f2ee7 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 9ac404275..b45b645de 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/clientbound_sound_packet.rs b/azalea-protocol/src/packets/game/clientbound_sound_packet.rs index 2b071f2e3..e60485a16 100755 --- 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 azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 5ea80e67c..dd601da99 100755 --- a/azalea-protocol/src/packets/game/clientbound_stop_sound_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_stop_sound_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::{BufReadError, McBufReadable, McBufWritable}; -use azalea_core::{FixedBitSet, ResourceLocation}; +use azalea_core::{bitset::FixedBitSet, resource_location::ResourceLocation}; use azalea_protocol_macros::ClientboundGamePacket; use std::io::{Cursor, Write}; 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 eceaa3aaa..c8fbc7180 100755 --- 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 azalea_core::Vec3; +use azalea_core::position::Vec3; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 5a792849c..2eb935194 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_advancements_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_chat::FormattedText; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_inventory::ItemSlot; use azalea_protocol_macros::ClientboundGamePacket; use std::collections::HashMap; @@ -119,7 +119,7 @@ pub struct AdvancementHolder { mod tests { use super::*; use azalea_buf::{McBufReadable, McBufWritable}; - use azalea_core::ResourceLocation; + use azalea_core::resource_location::ResourceLocation; use std::io::Cursor; #[test] 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 1468a77fb..147d36186 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_attributes_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_entity::attributes::AttributeModifier; use azalea_protocol_macros::ClientboundGamePacket; diff --git a/azalea-protocol/src/packets/game/clientbound_update_enabled_features_packet.rs b/azalea-protocol/src/packets/game/clientbound_update_enabled_features_packet.rs index 4f05b413b..e08358f77 100644 --- a/azalea-protocol/src/packets/game/clientbound_update_enabled_features_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_enabled_features_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; #[derive(Clone, Debug, McBuf, ClientboundGamePacket)] 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 0ebd2fed1..0699eb30b 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_recipes_packet.rs @@ -1,7 +1,7 @@ use azalea_buf::{ BufReadError, McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable, }; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_inventory::ItemSlot; use azalea_protocol_macros::ClientboundGamePacket; use azalea_registry::RecipeSerializer; 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 7cf507b4e..e861e5752 100755 --- a/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_update_tags_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::{BufReadError, McBuf, McBufVarReadable, McBufVarWritable}; use azalea_buf::{McBufReadable, McBufWritable}; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundGamePacket; use std::io::Cursor; use std::ops::Deref; 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 dcd4d0502..4b396a677 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] 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 16db0e093..460de5b25 100755 --- a/azalea-protocol/src/packets/game/serverbound_change_difficulty_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_change_difficulty_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::Difficulty; +use azalea_core::difficulty::Difficulty; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_chat_packet.rs b/azalea-protocol/src/packets/game/serverbound_chat_packet.rs index a19a9aa7e..e0a1726c7 100755 --- a/azalea-protocol/src/packets/game/serverbound_chat_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_chat_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::FixedBitSet; +use azalea_core::bitset::FixedBitSet; use azalea_crypto::MessageSignature; use azalea_protocol_macros::ServerboundGamePacket; 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 e1800e423..d5d46627b 100755 --- a/azalea-protocol/src/packets/game/serverbound_custom_payload_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_custom_payload_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; use azalea_buf::UnsizedByteArray; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] diff --git a/azalea-protocol/src/packets/game/serverbound_interact_packet.rs b/azalea-protocol/src/packets/game/serverbound_interact_packet.rs index a117ca6f9..315134c99 100755 --- a/azalea-protocol/src/packets/game/serverbound_interact_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_interact_packet.rs @@ -1,6 +1,6 @@ use crate::packets::BufReadError; use azalea_buf::{McBuf, McBufReadable, McBufVarReadable, McBufVarWritable, McBufWritable}; -use azalea_core::Vec3; +use azalea_core::position::Vec3; use azalea_protocol_macros::ServerboundGamePacket; use std::io::{Cursor, Write}; 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 f3cab5d4b..34fd5985c 100755 --- a/azalea-protocol/src/packets/game/serverbound_jigsaw_generate_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_jigsaw_generate_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] 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 c7aa6fd45..03dd833b2 100755 --- a/azalea-protocol/src/packets/game/serverbound_place_recipe_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_place_recipe_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] 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 1f8727ac2..384f7dcc8 100755 --- 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 azalea_core::FixedBitSet; +use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ServerboundGamePacket; use std::io::Cursor; 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 7091f3c19..6719202f7 100755 --- a/azalea-protocol/src/packets/game/serverbound_player_action_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_player_action_packet.rs @@ -1,6 +1,6 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; -use azalea_core::Direction; +use azalea_core::direction::Direction; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] 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 f0c7c5483..db6e51a9a 100755 --- a/azalea-protocol/src/packets/game/serverbound_player_input_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_player_input_packet.rs @@ -2,7 +2,7 @@ use std::io::Cursor; use azalea_buf::BufReadError; use azalea_buf::{McBufReadable, McBufWritable}; -use azalea_core::FixedBitSet; +use azalea_core::bitset::FixedBitSet; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, ServerboundGamePacket)] 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 e82462dfb..9923e3a6f 100755 --- 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,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; #[derive(Clone, Debug, McBuf, ServerboundGamePacket)] 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 5a9b0e488..fb15293b9 100755 --- a/azalea-protocol/src/packets/game/serverbound_seen_advancements_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_seen_advancements_packet.rs @@ -1,6 +1,6 @@ use crate::packets::BufReadError; use azalea_buf::{McBuf, McBufReadable, McBufWritable}; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; use std::io::Cursor; 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 d73654c26..c5feb2138 100755 --- 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,6 +1,6 @@ use crate::packets::McBufWritable; use azalea_buf::{BufReadError, McBuf, McBufReadable}; -use azalea_core::{BlockPos, FixedBitSet}; +use azalea_core::{bitset::FixedBitSet, position::BlockPos}; use azalea_protocol_macros::ServerboundGamePacket; use std::io::Cursor; 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 dbc08b162..a207147ac 100755 --- a/azalea-protocol/src/packets/game/serverbound_set_jigsaw_block_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_jigsaw_block_packet.rs @@ -2,8 +2,8 @@ use crate::packets::BufReadError; use crate::packets::McBufWritable; use azalea_buf::McBuf; use azalea_buf::McBufReadable; -use azalea_core::BlockPos; -use azalea_core::ResourceLocation; +use azalea_core::position::BlockPos; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ServerboundGamePacket; use std::io::Cursor; use std::io::Write; 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 28cc00358..c10966c98 100755 --- a/azalea-protocol/src/packets/game/serverbound_set_structure_block_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_set_structure_block_packet.rs @@ -1,7 +1,7 @@ use crate::packets::BufReadError; use azalea_buf::McBuf; use azalea_buf::{McBufReadable, McBufWritable}; -use azalea_core::{BlockPos, FixedBitSet}; +use azalea_core::{bitset::FixedBitSet, position::BlockPos}; use azalea_protocol_macros::ServerboundGamePacket; use std::io::{Cursor, Write}; 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 82e4c2b88..0547c7838 100755 --- a/azalea-protocol/src/packets/game/serverbound_sign_update_packet.rs +++ b/azalea-protocol/src/packets/game/serverbound_sign_update_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::McBuf; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_protocol_macros::ServerboundGamePacket; #[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 50cbe9149..2d4711146 100755 --- 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,6 +1,9 @@ use crate::packets::game::serverbound_interact_packet::InteractionHand; use azalea_buf::{BufReadError, McBuf, McBufReadable, McBufWritable}; -use azalea_core::{BlockPos, Direction, Vec3}; +use azalea_core::{ + direction::Direction, + position::{BlockPos, Vec3}, +}; use azalea_protocol_macros::ServerboundGamePacket; use std::io::{Cursor, Write}; 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 1a813ca87..50d2e2d35 100755 --- a/azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs +++ b/azalea-protocol/src/packets/login/clientbound_custom_query_packet.rs @@ -1,5 +1,5 @@ use azalea_buf::{McBuf, UnsizedByteArray}; -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use azalea_protocol_macros::ClientboundLoginPacket; use std::hash::Hash; diff --git a/azalea-world/src/chunk_storage.rs b/azalea-world/src/chunk_storage.rs index 8d894d9ab..f7800d2b4 100755 --- a/azalea-world/src/chunk_storage.rs +++ b/azalea-world/src/chunk_storage.rs @@ -4,7 +4,7 @@ use crate::palette::PalettedContainer; use crate::palette::PalettedContainerKind; use azalea_block::BlockState; use azalea_buf::{BufReadError, McBufReadable, McBufWritable}; -use azalea_core::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos}; +use azalea_core::position::{BlockPos, ChunkBlockPos, ChunkPos, ChunkSectionBlockPos}; use azalea_nbt::NbtCompound; use log::{debug, trace, warn}; use parking_lot::RwLock; diff --git a/azalea-world/src/container.rs b/azalea-world/src/container.rs index 79cf21056..471e1d5e0 100644 --- a/azalea-world/src/container.rs +++ b/azalea-world/src/container.rs @@ -1,4 +1,4 @@ -use azalea_core::ResourceLocation; +use azalea_core::resource_location::ResourceLocation; use bevy_ecs::{component::Component, system::Resource}; use derive_more::{Deref, DerefMut}; use log::error; diff --git a/azalea-world/src/heightmap.rs b/azalea-world/src/heightmap.rs index 5fa3f260a..12aaa1590 100644 --- a/azalea-world/src/heightmap.rs +++ b/azalea-world/src/heightmap.rs @@ -1,7 +1,7 @@ use std::{fmt::Display, str::FromStr}; use azalea_block::BlockState; -use azalea_core::{math, ChunkBlockPos}; +use azalea_core::{math, position::ChunkBlockPos}; use azalea_registry::tags::blocks::LEAVES; use crate::{chunk_storage::get_block_state_from_sections, BitStorage, Section}; diff --git a/azalea-world/src/iterators.rs b/azalea-world/src/iterators.rs index c7290781c..acb76cf60 100644 --- a/azalea-world/src/iterators.rs +++ b/azalea-world/src/iterators.rs @@ -1,12 +1,12 @@ //! Iterators for iterating over Minecraft blocks and chunks, based on //! [prismarine-world's iterators](https://github.com/PrismarineJS/prismarine-world/blob/master/src/iterators.js). -use azalea_core::{BlockPos, ChunkPos}; +use azalea_core::position::{BlockPos, ChunkPos}; /// An octahedron iterator, useful for iterating over blocks in a world. /// /// ``` -/// # use azalea_core::BlockPos; +/// # use azalea_core::position::BlockPos; /// # use azalea_world::iterators::BlockIterator; /// /// let mut iter = BlockIterator::new(BlockPos::default(), 4); @@ -81,7 +81,7 @@ impl Iterator for BlockIterator { /// `ChunkIterator` to sort by x+y+z (Manhattan) distance. /// /// ``` -/// # use azalea_core::ChunkPos; +/// # use azalea_core::position::ChunkPos; /// # use azalea_world::iterators::SquareChunkIterator; /// /// let mut iter = SquareChunkIterator::new(ChunkPos::default(), 4); @@ -118,7 +118,7 @@ impl SquareChunkIterator { /// Change the distance that this iterator won't go past. /// /// ``` - /// # use azalea_core::ChunkPos; + /// # use azalea_core::position::ChunkPos; /// # use azalea_world::iterators::SquareChunkIterator; /// /// let mut iter = SquareChunkIterator::new(ChunkPos::default(), 2); @@ -169,7 +169,7 @@ impl Iterator for SquareChunkIterator { /// A diagonal spiral iterator, useful for iterating over chunks in a world. /// /// ``` -/// # use azalea_core::ChunkPos; +/// # use azalea_core::position::ChunkPos; /// # use azalea_world::iterators::ChunkIterator; /// /// let mut iter = ChunkIterator::new(ChunkPos::default(), 4); diff --git a/azalea-world/src/world.rs b/azalea-world/src/world.rs index df462be43..63e1d7707 100644 --- a/azalea-world/src/world.rs +++ b/azalea-world/src/world.rs @@ -1,6 +1,6 @@ use crate::{iterators::ChunkIterator, palette::Palette, ChunkStorage, PartialChunkStorage}; use azalea_block::{BlockState, BlockStates, FluidState}; -use azalea_core::{BlockPos, ChunkPos}; +use azalea_core::position::{BlockPos, ChunkPos}; use bevy_ecs::{component::Component, entity::Entity}; use derive_more::{Deref, DerefMut}; use nohash_hasher::IntMap; diff --git a/azalea/examples/testbot.rs b/azalea/examples/testbot.rs index 73870b596..de36a7ae6 100644 --- a/azalea/examples/testbot.rs +++ b/azalea/examples/testbot.rs @@ -10,7 +10,7 @@ use azalea::pathfinder::goals::BlockPosGoal; use azalea::{prelude::*, swarm::prelude::*, BlockPos, GameProfileComponent, WalkDirection}; use azalea::{Account, Client, Event}; use azalea_client::SprintDirection; -use azalea_core::{ChunkBlockPos, ChunkPos, Vec3}; +use azalea_core::position::{ChunkBlockPos, ChunkPos, Vec3}; use azalea_protocol::packets::game::ClientboundGamePacket; use azalea_world::heightmap::HeightmapKind; use azalea_world::{InstanceName, MinecraftEntityId}; diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs index 3b9e7e529..352eda590 100644 --- a/azalea/src/bot.rs +++ b/azalea/src/bot.rs @@ -12,7 +12,7 @@ use crate::ecs::{ use azalea_client::interact::SwingArmEvent; use azalea_client::mining::Mining; use azalea_client::TickBroadcast; -use azalea_core::{BlockPos, Vec3}; +use azalea_core::position::{BlockPos, Vec3}; use azalea_entity::{ clamp_look_direction, metadata::Player, EyeHeight, Jumping, LocalEntity, LookDirection, Position, diff --git a/azalea/src/container.rs b/azalea/src/container.rs index 56770524f..ef6fdcf68 100644 --- a/azalea/src/container.rs +++ b/azalea/src/container.rs @@ -5,7 +5,7 @@ use azalea_client::{ packet_handling::game::PacketEvent, Client, }; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_inventory::{operations::ClickOperation, ItemSlot, Menu}; use azalea_protocol::packets::game::ClientboundGamePacket; use bevy_app::{App, Plugin, Update}; diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index b6cd4e9db..5c1edf777 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -20,7 +20,12 @@ pub use azalea_block as blocks; pub use azalea_brigadier as brigadier; pub use azalea_chat::FormattedText; pub use azalea_client::*; -pub use azalea_core::{BlockPos, ChunkPos, ResourceLocation, Vec3}; +pub use azalea_core as core; +// these are re-exported on this level because they're very common +pub use azalea_core::{ + position::{BlockPos, Vec3}, + resource_location::ResourceLocation, +}; pub use azalea_entity as entity; pub use azalea_protocol as protocol; pub use azalea_registry as registry; diff --git a/azalea/src/pathfinder/goals.rs b/azalea/src/pathfinder/goals.rs index 29c97ff05..4e278c740 100644 --- a/azalea/src/pathfinder/goals.rs +++ b/azalea/src/pathfinder/goals.rs @@ -1,4 +1,4 @@ -use azalea_core::{BlockPos, Vec3}; +use azalea_core::position::{BlockPos, Vec3}; use super::Goal; diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs index b8a027987..1b35718e8 100644 --- a/azalea/src/pathfinder/mod.rs +++ b/azalea/src/pathfinder/mod.rs @@ -21,7 +21,7 @@ use crate::ecs::{ }; use azalea_client::movement::walk_listener; use azalea_client::{StartSprintEvent, StartWalkEvent}; -use azalea_core::BlockPos; +use azalea_core::position::BlockPos; use azalea_entity::metadata::Player; use azalea_entity::LocalEntity; use azalea_entity::{Physics, Position}; @@ -546,7 +546,7 @@ where mod tests { use std::{collections::HashSet, sync::Arc}; - use azalea_core::{BlockPos, ChunkPos, Vec3}; + use azalea_core::position::{BlockPos, ChunkPos, Vec3}; use azalea_world::{Chunk, ChunkStorage, PartialChunkStorage}; use log::info; diff --git a/azalea/src/pathfinder/moves/basic.rs b/azalea/src/pathfinder/moves/basic.rs index b8cbbbb76..abd750b32 100644 --- a/azalea/src/pathfinder/moves/basic.rs +++ b/azalea/src/pathfinder/moves/basic.rs @@ -1,7 +1,7 @@ use std::f32::consts::SQRT_2; use azalea_client::{SprintDirection, StartSprintEvent, StartWalkEvent, WalkDirection}; -use azalea_core::{BlockPos, CardinalDirection}; +use azalea_core::{direction::CardinalDirection, position::BlockPos}; use azalea_world::Instance; use crate::{ diff --git a/azalea/src/pathfinder/moves/mod.rs b/azalea/src/pathfinder/moves/mod.rs index f3ed7dffa..d631ac8a2 100644 --- a/azalea/src/pathfinder/moves/mod.rs +++ b/azalea/src/pathfinder/moves/mod.rs @@ -7,7 +7,7 @@ use crate::{JumpEvent, LookAtEvent}; use super::astar; use azalea_client::{StartSprintEvent, StartWalkEvent}; -use azalea_core::{BlockPos, Vec3}; +use azalea_core::position::{BlockPos, Vec3}; use azalea_physics::collision::{self, BlockWithShape}; use azalea_world::Instance; use bevy_ecs::{entity::Entity, event::EventWriter}; @@ -137,7 +137,7 @@ pub fn default_is_reached( mod tests { use super::*; use azalea_block::BlockState; - use azalea_core::ChunkPos; + use azalea_core::position::ChunkPos; use azalea_world::{Chunk, ChunkStorage, PartialInstance}; #[test] diff --git a/azalea/src/pathfinder/moves/parkour.rs b/azalea/src/pathfinder/moves/parkour.rs index 5f81149b9..ab9c509c3 100644 --- a/azalea/src/pathfinder/moves/parkour.rs +++ b/azalea/src/pathfinder/moves/parkour.rs @@ -1,5 +1,5 @@ use azalea_client::{SprintDirection, StartSprintEvent, StartWalkEvent, WalkDirection}; -use azalea_core::{BlockPos, CardinalDirection}; +use azalea_core::{direction::CardinalDirection, position::BlockPos}; use azalea_world::Instance; use crate::{ diff --git a/azalea/src/pathfinder/simulation.rs b/azalea/src/pathfinder/simulation.rs index e0f824331..565e3e92e 100644 --- a/azalea/src/pathfinder/simulation.rs +++ b/azalea/src/pathfinder/simulation.rs @@ -3,7 +3,7 @@ use std::{sync::Arc, time::Duration}; use azalea_client::PhysicsState; -use azalea_core::{ResourceLocation, Vec3}; +use azalea_core::{position::Vec3, resource_location::ResourceLocation}; use azalea_entity::{ attributes::AttributeInstance, metadata::Sprinting, Attributes, EntityDimensions, Physics, Position, diff --git a/codegen/lib/code/entity.py b/codegen/lib/code/entity.py index 45210b5ed..7be6b01d5 100644 --- a/codegen/lib/code/entity.py +++ b/codegen/lib/code/entity.py @@ -105,7 +105,7 @@ def generate_entity_metadata(burger_entities_data: dict, mappings: Mappings): SnifferState, VillagerData }; use azalea_chat::FormattedText; -use azalea_core::{particle::Particle, BlockPos, Direction, Vec3}; +use azalea_core::{particle::Particle, position::{BlockPos, Vec3}, direction::Direction}; use azalea_inventory::ItemSlot; use bevy_ecs::{bundle::Bundle, component::Component}; use derive_more::{Deref, DerefMut}; diff --git a/codegen/lib/code/utils.py b/codegen/lib/code/utils.py index 6dd910dc8..0050ce7be 100755 --- a/codegen/lib/code/utils.py +++ b/codegen/lib/code/utils.py @@ -48,18 +48,18 @@ def burger_type_to_rust_type(burger_type, field_name: Optional[str] = None, inst uses.add('azalea_chat::FormattedText') elif burger_type == 'identifier': field_type_rs = 'ResourceLocation' - uses.add('azalea_core::ResourceLocation') + uses.add('azalea_core::resource_location::ResourceLocation') elif burger_type == 'uuid': field_type_rs = 'Uuid' uses.add('uuid::Uuid') elif burger_type == 'position': field_type_rs = 'BlockPos' - uses.add('azalea_core::BlockPos') + uses.add('azalea_core::position::BlockPos') elif burger_type == 'nbtcompound': field_type_rs = 'azalea_nbt::Nbt' elif burger_type == 'itemstack': field_type_rs = 'Slot' - uses.add('azalea_core::Slot') + uses.add('azalea_core::slot::Slot') elif burger_type == 'metadata': field_type_rs = 'EntityMetadata' uses.add('azalea_entity::EntityMetadata')