1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

Create azalea-entity

This commit is contained in:
mat 2022-06-17 20:46:16 -05:00
parent fcdb6d31ee
commit f993e79a7e
8 changed files with 37 additions and 11 deletions

8
Cargo.lock generated
View file

@ -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"

View file

@ -12,6 +12,7 @@ members = [
"azalea-world",
"azalea-language",
"azalea-block",
"azalea-entity",
]
[profile.release]

View file

@ -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"]}

View file

@ -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,
}

View file

@ -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)]

View file

@ -1,4 +1,4 @@
use crate::Entity;
use azalea_entity::Entity;
#[derive(Default, Debug)]
pub struct Player {

9
azalea-entity/Cargo.toml Normal file
View file

@ -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"}

17
azalea-entity/src/lib.rs Normal file
View file

@ -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);
// }
// }