aboutsummaryrefslogtreecommitdiff
path: root/bot
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-05-15 01:46:11 +0000
committerGitHub <noreply@github.com>2022-05-15 01:46:11 +0000
commitd0ac62d85276bc48e4f8e0e60afdc35840681622 (patch)
treeff4996b89d6f34c7c452d1b2950e53d512bce3c1 /bot
parentef3cbe27f2a7eed5c635924d6fa0401dd04eae77 (diff)
parentc16e958d0be671a17edf060aee9850faccbcfe14 (diff)
downloadazalea-drasl-d0ac62d85276bc48e4f8e0e60afdc35840681622.tar.xz
Merge pull request #6 from mat-1/chunk-decoding
Chunk decoding
Diffstat (limited to 'bot')
-rwxr-xr-xbot/Cargo.toml1
-rw-r--r--bot/src/main.rs10
2 files changed, 10 insertions, 1 deletions
diff --git a/bot/Cargo.toml b/bot/Cargo.toml
index fd6ad067..e55f6c3d 100755
--- a/bot/Cargo.toml
+++ b/bot/Cargo.toml
@@ -7,5 +7,6 @@ version = "0.1.0"
[dependencies]
azalea-client = {path = "../azalea-client"}
+azalea-core = {path = "../azalea-core"}
azalea-protocol = {path = "../azalea-protocol"}
tokio = "^1.14.0"
diff --git a/bot/src/main.rs b/bot/src/main.rs
index 9d10eaa6..76a5a15d 100644
--- a/bot/src/main.rs
+++ b/bot/src/main.rs
@@ -1,11 +1,12 @@
use azalea_client::{Account, Event};
+use azalea_core::BlockPos;
#[tokio::main]
async fn main() {
println!("Hello, world!");
// let address = "95.111.249.143:10000";
- let address = "172.23.192.1:61385";
+ let address = "192.168.2.234:50736";
// let response = azalea_client::ping::ping_server(&address.try_into().unwrap())
// .await
// .unwrap();
@@ -17,9 +18,16 @@ async fn main() {
while let Some(e) = client.next().await {
match e {
+ // TODO: have a "loaded" or "ready" event that fires when all chunks are loaded
Event::Login => {}
Event::Chat(p) => {
println!("{}", p.message.to_ansi(None));
+ if p.message.to_ansi(None) == "<py5> ok" {
+ let state = client.state.lock().await;
+ let world = state.world.as_ref().unwrap();
+ let c = world.get_block_state(&BlockPos::new(5, 78, -2)).unwrap();
+ println!("block state: {:?}", c);
+ }
}
}
}