aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-04-04 13:48:48 -0845
committermat <git@matdoes.dev>2025-04-04 13:48:48 -0845
commitadf8a604c400c19df8e28d6345abf2c0a8c32d05 (patch)
tree8e331a3580756dbd5f7336e9d691f26de93d168b
parentefc28db6cfa3cf45561610dcba9b2819553aa025 (diff)
downloadazalea-drasl-adf8a604c400c19df8e28d6345abf2c0a8c32d05.tar.xz
fix ordering for handle_attack_queued
-rw-r--r--azalea-client/src/plugins/attack.rs4
-rw-r--r--azalea-client/src/plugins/movement.rs2
-rw-r--r--azalea/examples/testbot/commands/movement.rs2
3 files changed, 5 insertions, 3 deletions
diff --git a/azalea-client/src/plugins/attack.rs b/azalea-client/src/plugins/attack.rs
index 34122108..c9ecde56 100644
--- a/azalea-client/src/plugins/attack.rs
+++ b/azalea-client/src/plugins/attack.rs
@@ -33,7 +33,9 @@ impl Plugin for AttackPlugin {
(
increment_ticks_since_last_attack,
update_attack_strength_scale.after(PhysicsSet),
- handle_attack_queued.before(super::tick_end::game_tick_packet),
+ handle_attack_queued
+ .before(super::tick_end::game_tick_packet)
+ .after(super::movement::send_sprinting_if_needed),
)
.chain(),
);
diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs
index 1a02fd21..f45ead9c 100644
--- a/azalea-client/src/plugins/movement.rs
+++ b/azalea-client/src/plugins/movement.rs
@@ -287,7 +287,7 @@ pub fn send_player_input_packet(
}
}
-fn send_sprinting_if_needed(
+pub fn send_sprinting_if_needed(
mut query: Query<(Entity, &MinecraftEntityId, &Sprinting, &mut PhysicsState)>,
mut commands: Commands,
) {
diff --git a/azalea/examples/testbot/commands/movement.rs b/azalea/examples/testbot/commands/movement.rs
index 114c3c31..a400809b 100644
--- a/azalea/examples/testbot/commands/movement.rs
+++ b/azalea/examples/testbot/commands/movement.rs
@@ -77,7 +77,7 @@ pub fn register(commands: &mut CommandDispatcher<Mutex<CommandSource>>) {
commands.register(literal("down").executes(|ctx: &Ctx| {
let source = ctx.source.clone();
tokio::spawn(async move {
- let mut bot = source.lock().bot.clone();
+ let bot = source.lock().bot.clone();
let position = BlockPos::from(bot.position());
source.lock().reply("mining...");
bot.mine(position.down(1)).await;