Skip to content

Commit 0038b70

Browse files
committed
Update Azalea
1 parent e4567b6 commit 0038b70

17 files changed

+571
-488
lines changed

Cargo.lock

Lines changed: 506 additions & 418 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "shaysbot"
3-
version = "0.15.17"
3+
version = "0.15.18"
44
authors = ["Shayne Hartford <shaybox@shaybox.com>"]
55
edition = "2024"
66
description = "My personal Minecraft bot using Azalea"

Makefile.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[tasks.build-aarch64]
2+
command = "cross"
3+
args = ["build", "--release", "--target", "aarch64-unknown-linux-gnu"]
4+
5+
[tasks.upload-vps]
6+
dependencies = ["build-aarch64"]
7+
script = '''
8+
scp target/aarch64-unknown-linux-gnu/release/shaysbot pearl@vps:/home/pearl/.local/bin/shaysbot
9+
'''

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[toolchain]
2-
channel = "nightly"
2+
channel = "nightly-2025-06-18"

src/commands/interact.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ use anyhow::Result;
22
use azalea::{
33
app::{App, Plugin, Update},
44
ecs::prelude::*,
5-
interact::BlockInteractEvent,
5+
interact::StartUseItemEvent,
6+
protocol::packets::game::s_interact::InteractionHand,
67
BlockPos,
78
};
89

@@ -36,7 +37,7 @@ impl InteractCommandPlugin {
3637
pub fn handle_interact_cmd_events(
3738
mut cmd_events: EventReader<CmdEvent>,
3839
mut msg_events: EventWriter<MsgEvent>,
39-
mut block_interact_events: EventWriter<BlockInteractEvent>,
40+
mut block_interact_events: EventWriter<StartUseItemEvent>,
4041
) {
4142
for event in cmd_events.read().cloned() {
4243
let (Cmds::Interact(_plugin), Some(entity)) = (event.cmd, event.entity) else {
@@ -70,7 +71,11 @@ impl InteractCommandPlugin {
7071
return;
7172
};
7273

73-
block_interact_events.write(BlockInteractEvent { entity, position });
74+
block_interact_events.write(StartUseItemEvent {
75+
entity,
76+
hand: InteractionHand::MainHand,
77+
force_block: Some(position),
78+
});
7479
msg_events.write(msg_event);
7580
}
7681

src/commands/leave.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use azalea::{
22
app::{App, Plugin, Update},
33
disconnect::DisconnectEvent,
44
ecs::prelude::*,
5-
GameProfileComponent,
5+
player::GameProfileComponent,
66
};
77

88
use crate::prelude::*;

src/commands/pearl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use azalea::{
22
app::{App, Plugin, Update},
33
ecs::prelude::*,
44
entity::Position,
5+
local_player::TabList,
56
BlockPos,
6-
TabList,
77
};
88

99
use crate::prelude::*;

src/commands/whitelist.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use azalea::{
22
app::{App, Plugin, Update},
33
ecs::prelude::*,
4-
PlayerInfo,
5-
TabList,
4+
local_player::TabList,
5+
player::PlayerInfo,
66
};
77
#[cfg(feature = "bot")]
88
use serde::Deserialize;

src/modules/auto_eat.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use azalea::{
1010
Inventory,
1111
InventorySet,
1212
},
13+
local_player::Hunger,
1314
mining::continue_mining_block,
1415
packet::game::{handle_outgoing_packets, SendPacketEvent},
1516
physics::PhysicsSet,
@@ -20,7 +21,6 @@ use azalea::{
2021
ServerboundUseItem,
2122
},
2223
registry::Item,
23-
Hunger,
2424
};
2525

2626
use crate::prelude::*;
@@ -109,10 +109,10 @@ impl AutoEatPlugin {
109109
}
110110

111111
let packet = ServerboundGamePacket::UseItem(ServerboundUseItem {
112-
hand: InteractionHand::MainHand,
113-
pitch: direction.x_rot,
114-
yaw: direction.y_rot,
115-
sequence: 0,
112+
hand: InteractionHand::MainHand,
113+
x_rot: direction.x_rot,
114+
y_rot: direction.y_rot,
115+
seq: 0,
116116
});
117117

118118
packet_events.write(SendPacketEvent {

src/modules/auto_kill.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ use azalea::{
1515
physics::PhysicsSet,
1616
prelude::*,
1717
registry::Item,
18-
world::MinecraftEntityId,
1918
LookAtEvent,
2019
};
2120

@@ -42,7 +41,7 @@ impl AutoKillPlugin {
4241
pub fn handle_auto_kill(
4342
mut query: Query<(Entity, &LocalSettings, &GameTicks, &Inventory, &Pathfinder)>,
4443
entities: EntityFinder<With<AbstractMonster>>,
45-
targets: Query<(&MinecraftEntityId, &Position, Option<&EyeHeight>)>,
44+
targets: Query<(&Position, Option<&EyeHeight>)>,
4645
mut container_click_events: EventWriter<ContainerClickEvent>,
4746
mut look_at_events: EventWriter<LookAtEvent>,
4847
mut attack_events: EventWriter<AttackEvent>,
@@ -60,7 +59,7 @@ impl AutoKillPlugin {
6059
continue;
6160
};
6261

63-
let Ok((target_id, target_pos, target_eye_height)) = targets.get(target) else {
62+
let Ok((target_pos, target_eye_height)) = targets.get(target) else {
6463
continue;
6564
};
6665

@@ -107,10 +106,7 @@ impl AutoKillPlugin {
107106
}
108107
}
109108

110-
attack_events.write(AttackEvent {
111-
entity,
112-
target: *target_id,
113-
});
109+
attack_events.write(AttackEvent { entity, target });
114110
}
115111
}
116112
}

0 commit comments

Comments
 (0)