Skip to content

Commit

Permalink
0.6.4 - Fix Idle Position
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayBox committed Nov 10, 2024
1 parent ad502b8 commit 8987d91
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion 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.6.3"
version = "0.6.4"
authors = ["Shayne Hartford <shaybox@shaybox.com>"]
edition = "2021"
description = "My personal Minecraft bot using Azalea"
Expand Down
11 changes: 8 additions & 3 deletions src/plugins/auto_pearl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,16 @@ pub fn handle_pearl_pull_event(
});

// Return to the idle position
let pos = settings.idle_pos;
if pos.x == -0.0 && pos.y == -0.0 && pos.z == -0.0 {
continue;
};

#[allow(clippy::cast_possible_truncation)]
let pos = BlockPos {
x: settings.idle_pos.x as i32,
y: settings.idle_pos.y as i32,
z: settings.idle_pos.z as i32,
x: pos.x as i32,
y: pos.y as i32,
z: pos.z as i32,
};

let goal = ReachBlockPosGoal {
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/pearl_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ pub fn handle_add_entity_packet(
continue;
};

/* Player is outside visual range */
let owner_uuid = if packet.data == 0 {
Uuid::max()
Uuid::max() /* Player is offline */
} else if let Some((_, profile)) = profiles
.iter()
.find(|(id, _)| i32::try_from(id.0).unwrap() == packet.data)
Expand Down

0 comments on commit 8987d91

Please sign in to comment.