Skip to content

Commit

Permalink
0.9.1 - Fix Use Item On
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayBox committed Nov 30, 2024
1 parent 45976f5 commit 982bb00
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 31 deletions.
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "shaysbot"
version = "0.9.0"
version = "0.9.1"
authors = ["Shayne Hartford <shaybox@shaybox.com>"]
edition = "2021"
description = "My personal Minecraft bot using Azalea"
Expand Down
7 changes: 3 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,12 @@ pub async fn swarm_handler(mut swarm: Swarm, event: SwarmEvent, state: SwarmStat
SwarmEvent::Chat(chat_packet) => info!("{}", chat_packet.message().to_ansi()),
SwarmEvent::Disconnect(ref account, ref join_opts) => loop {
let uuid = account.uuid_or_offline();
let auto_reconnect = state.auto_reconnect.read().clone();
if !auto_reconnect.get(&uuid).unwrap_or(&true) {
tokio::time::sleep(Duration::from_secs(5)).await;
if !state.auto_reconnect.read().get(&uuid).unwrap_or(&true) {
continue;
}

info!("[AutoReconnect] Reconnecting...");
info!("[AutoReconnect] Reconnecting in 5 seconds...");
tokio::time::sleep(Duration::from_secs(5)).await;
match swarm.add_with_opts(account, state.clone(), join_opts).await {
Err(error) => error!("Error: {error}"),
Ok(_) => break,
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/auto_pearl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,15 @@ pub fn handle_pearl_pull_event(
let packet = ServerboundGamePacket::UseItemOn(ServerboundUseItemOn {
hand: InteractionHand::MainHand,
block_hit: BlockHit {
block_pos: event.block_pos,
direction: Direction::Down,
location: Vec3 {
block_pos: event.block_pos,
direction: Direction::Down,
location: Vec3 {
x: f64::from(event.block_pos.x) + 0.5,
y: f64::from(event.block_pos.y) + 0.5,
z: f64::from(event.block_pos.z) + 0.5,
},
inside: false,
inside: false,
world_border: false,
},
sequence: 0,
});
Expand Down

0 comments on commit 982bb00

Please sign in to comment.