diff --git a/Cargo.lock b/Cargo.lock index f3b5df08..85dc7a98 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,6 +106,7 @@ dependencies = [ "azalea-auth", "azalea-core", "azalea-crypto", + "azalea-entity", "azalea-protocol", "azalea-world", "tokio", @@ -132,6 +133,13 @@ dependencies = [ "sha-1", ] +[[package]] +name = "azalea-entity" +version = "0.1.0" +dependencies = [ + "azalea-core", +] + [[package]] name = "azalea-language" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 484da0b2..fc32b2d9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ members = [ "azalea-world", "azalea-language", "azalea-block", + "azalea-entity", ] [profile.release] diff --git a/azalea-client/Cargo.toml b/azalea-client/Cargo.toml index 1156f8de..cc34f03a 100755 --- a/azalea-client/Cargo.toml +++ b/azalea-client/Cargo.toml @@ -9,6 +9,7 @@ version = "0.1.0" azalea-auth = {path = "../azalea-auth"} azalea-core = {path = "../azalea-core"} azalea-crypto = {path = "../azalea-crypto"} +azalea-entity = {path = "../azalea-entity"} azalea-protocol = {path = "../azalea-protocol"} azalea-world = {path = "../azalea-world"} tokio = {version = "1.18.0", features = ["sync"]} diff --git a/azalea-client/src/entity.rs b/azalea-client/src/entity.rs deleted file mode 100644 index d91f556f..00000000 --- a/azalea-client/src/entity.rs +++ /dev/null @@ -1,8 +0,0 @@ -use azalea_core::EntityPos; - -#[derive(Default, Debug)] -pub struct Entity { - /// The incremental numerical id of the entity. - pub id: u32, - pub pos: EntityPos, -} diff --git a/azalea-client/src/lib.rs b/azalea-client/src/lib.rs index 5814687a..db935897 100755 --- a/azalea-client/src/lib.rs +++ b/azalea-client/src/lib.rs @@ -1,12 +1,10 @@ //! Significantly abstract azalea-protocol so it's actually useable for bots. mod connect; -mod entity; pub mod ping; mod player; pub use connect::{Account, Client, Event}; -pub use entity::Entity; pub use player::Player; #[cfg(test)] diff --git a/azalea-client/src/player.rs b/azalea-client/src/player.rs index 04d34f6d..9a5ba8ab 100644 --- a/azalea-client/src/player.rs +++ b/azalea-client/src/player.rs @@ -1,4 +1,4 @@ -use crate::Entity; +use azalea_entity::Entity; #[derive(Default, Debug)] pub struct Player { diff --git a/azalea-entity/Cargo.toml b/azalea-entity/Cargo.toml new file mode 100644 index 00000000..bf1e64bc --- /dev/null +++ b/azalea-entity/Cargo.toml @@ -0,0 +1,9 @@ +[package] +edition = "2021" +name = "azalea-entity" +version = "0.1.0" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +azalea-core = {path = "../azalea-core"} diff --git a/azalea-entity/src/lib.rs b/azalea-entity/src/lib.rs new file mode 100644 index 00000000..506f5780 --- /dev/null +++ b/azalea-entity/src/lib.rs @@ -0,0 +1,17 @@ +use azalea_core::EntityPos; + +#[derive(Default, Debug)] +pub struct Entity { + /// The incrementing numerical id of the entity. + pub id: u32, + pub pos: EntityPos, +} + +// #[cfg(test)] +// mod tests { +// #[test] +// fn it_works() { +// let result = 2 + 2; +// assert_eq!(result, 4); +// } +// }