Skip to content

Commit d27289e

Browse files
build(deps): update azalea
1 parent 505b1a2 commit d27289e

12 files changed

Lines changed: 99 additions & 97 deletions

File tree

Cargo.lock

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

src/events.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ pub async fn handle_event(client: Client, event: Event, state: State) -> Result<
125125
}
126126
}
127127
Event::KeepAlive(id) => call_listeners(&state, "keep_alive", || Ok(id)).await,
128-
Event::Login => call_listeners(&state, "login", || Ok(())).await,
129128
Event::RemovePlayer(player_info) => {
130129
call_listeners(&state, "remove_player", || Ok(Player::from(player_info))).await
131130
}
@@ -201,6 +200,12 @@ pub async fn handle_event(client: Client, event: Event, state: State) -> Result<
201200
}
202201
_ => Ok(()),
203202
},
203+
Event::Login => {
204+
#[cfg(feature = "matrix")]
205+
matrix_init(&client, state.clone());
206+
207+
call_listeners(&state, "login", || Ok(())).await
208+
}
204209
Event::Init => {
205210
debug!("received init event");
206211

@@ -212,9 +217,6 @@ pub async fn handle_event(client: Client, event: Event, state: State) -> Result<
212217
exit(0);
213218
})?;
214219

215-
#[cfg(feature = "matrix")]
216-
matrix_init(&client, state.clone());
217-
218220
let globals = state.lua.globals();
219221
lua_init(client, &state, &globals).await?;
220222

src/hacks/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
pub mod anti_knockback;
44

55
use anti_knockback::anti_knockback;
6-
use azalea::{movement::handle_knockback, packet::game::process_packet_events};
6+
use azalea::{connection::read_packets, movement::handle_knockback};
77
use bevy_app::{App, Plugin, PreUpdate};
88
use bevy_ecs::schedule::IntoSystemConfigs;
99

@@ -13,9 +13,7 @@ impl Plugin for HacksPlugin {
1313
fn build(&self, app: &mut App) {
1414
app.add_systems(
1515
PreUpdate,
16-
anti_knockback
17-
.after(process_packet_events)
18-
.before(handle_knockback),
16+
anti_knockback.after(read_packets).before(handle_knockback),
1917
);
2018
}
2119
}

src/lua/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub async fn get_block_states(
6060
true
6161
})
6262
{
63-
matched.push(block.id);
63+
matched.push(block.id());
6464
}
6565
}
6666
}

src/lua/client/container.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use azalea::{
44
prelude::ContainerClientExt,
55
protocol::packets::game::ServerboundSetCarriedItem,
66
};
7-
use log::error;
87
use mlua::{Lua, Result, UserDataRef, Value};
98

109
use super::{Client, Container, ContainerRef, ItemStack, Vec3};
@@ -126,11 +125,8 @@ pub fn set_held_slot(_lua: &Lua, client: &Client, slot: u8) -> Result<()> {
126125
inventory.selected_hotbar_slot = slot;
127126
};
128127

129-
if let Err(error) = client.write_packet(ServerboundSetCarriedItem {
128+
client.write_packet(ServerboundSetCarriedItem {
130129
slot: u16::from(slot),
131-
}) {
132-
error!("failed to send SetCarriedItem packet: {error:?}");
133-
}
134-
130+
});
135131
Ok(())
136132
}

src/lua/client/interaction.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use azalea::{
33
protocol::packets::game::{ServerboundUseItem, s_interact::InteractionHand},
44
world::MinecraftEntityId,
55
};
6-
use log::error;
76
use mlua::{Lua, Result, UserDataRef};
87

98
use super::{Client, Vec3};
@@ -57,16 +56,14 @@ pub fn start_mining(_lua: &Lua, client: &Client, position: Vec3) -> Result<()> {
5756

5857
pub fn use_item(_lua: &Lua, client: &Client, hand: Option<u8>) -> Result<()> {
5958
let direction = client.direction();
60-
if let Err(error) = client.write_packet(ServerboundUseItem {
59+
client.write_packet(ServerboundUseItem {
6160
hand: match hand {
6261
Some(1) => InteractionHand::OffHand,
6362
_ => InteractionHand::MainHand,
6463
},
6564
sequence: 0,
6665
yaw: direction.0,
6766
pitch: direction.1,
68-
}) {
69-
error!("failed to send UseItem packet: {error:?}");
70-
}
67+
});
7168
Ok(())
7269
}

0 commit comments

Comments
 (0)