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

start adding stuff to azalea crate

This commit is contained in:
mat 2022-10-02 15:02:27 -05:00
parent 06068377bd
commit e0bcab53b8
6 changed files with 24 additions and 6 deletions

1
Cargo.lock generated
View file

@ -103,6 +103,7 @@ name = "azalea"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"azalea-client",
"env_logger", "env_logger",
"tokio", "tokio",
] ]

View file

@ -9,9 +9,9 @@ version = "0.1.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
azalea-client = {version = "0.1.0", path = "../azalea-client"}
[dev-dependencies] [dev-dependencies]
tokio = "^1.21.1"
env_logger = "^0.9.1"
anyhow = "^1.0.65" anyhow = "^1.0.65"
env_logger = "^0.9.1"
tokio = "^1.21.1"

View file

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

14
azalea/src/bot.rs Normal file
View file

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

View file

@ -1,2 +1,4 @@
//! This is currently an advertisement crate for mod bot;
//! [Azalea](https://github.com/mat-1/azalea). More stuff will be here soon! pub mod prelude;
pub use azalea_client::Client;

1
azalea/src/prelude.rs Normal file
View file

@ -0,0 +1 @@
pub use crate::bot::BotTrait;