diff --git a/Cargo.lock b/Cargo.lock index 9d1ba73f..00ac6582 100755 --- a/Cargo.lock +++ b/Cargo.lock @@ -103,6 +103,7 @@ name = "azalea" version = "0.1.0" dependencies = [ "anyhow", + "azalea-client", "env_logger", "tokio", ] diff --git a/azalea/Cargo.toml b/azalea/Cargo.toml index 0256194e..77f07ab3 100644 --- a/azalea/Cargo.toml +++ b/azalea/Cargo.toml @@ -9,9 +9,9 @@ version = "0.1.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] - +azalea-client = {version = "0.1.0", path = "../azalea-client"} [dev-dependencies] -tokio = "^1.21.1" -env_logger = "^0.9.1" anyhow = "^1.0.65" +env_logger = "^0.9.1" +tokio = "^1.21.1" diff --git a/azalea/README.md b/azalea/README.md index fa77cd12..6678052c 100644 --- a/azalea/README.md +++ b/azalea/README.md @@ -1 +1 @@ -This is currently an advertisement crate for [Azalea](https://github.com/mat-1/azalea), it will have more stuff later! +A wrapper over azalea-client, adding useful functions for making bots. diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs new file mode 100644 index 00000000..6746e09e --- /dev/null +++ b/azalea/src/bot.rs @@ -0,0 +1,14 @@ +pub struct BotState { + jumping_once: bool, +} + +pub trait BotTrait { + fn jump(&mut self); +} + +impl BotTrait for azalea_client::Client { + fn jump(&mut self) { + let mut physics_state = self.physics_state.lock().unwrap(); + physics_state.jumping_once = true; + } +} diff --git a/azalea/src/lib.rs b/azalea/src/lib.rs index 144caa55..fe8a3740 100644 --- a/azalea/src/lib.rs +++ b/azalea/src/lib.rs @@ -1,2 +1,4 @@ -//! This is currently an advertisement crate for -//! [Azalea](https://github.com/mat-1/azalea). More stuff will be here soon! +mod bot; +pub mod prelude; + +pub use azalea_client::Client; diff --git a/azalea/src/prelude.rs b/azalea/src/prelude.rs new file mode 100644 index 00000000..7b3345b0 --- /dev/null +++ b/azalea/src/prelude.rs @@ -0,0 +1 @@ +pub use crate::bot::BotTrait;