chore(cargo): update dependencies

This commit is contained in:
2025-02-22 12:34:05 -05:00
parent 9b586e9b47
commit 9b9ccfd2b9
4 changed files with 62 additions and 59 deletions

View File

@@ -53,7 +53,7 @@ pub async fn handle_event(client: Client, event: Event, state: State) -> anyhow:
Event::Death(Some(packet)) => {
let death_data = state.lua.create_table()?;
death_data.set("message", packet.message.to_string())?;
death_data.set("player_id", packet.player_id)?;
death_data.set("player_id", packet.player_id.0)?;
call_listeners(&state, "death", death_data).await;
}
Event::Disconnect(message) => {

View File

@@ -8,7 +8,7 @@ use azalea::{
use log::error;
use mlua::{Lua, Result, UserDataRef};
pub async fn attack(_lua: Lua, client: UserDataRef<Client>, entity_id: u32) -> Result<()> {
pub async fn attack(_lua: Lua, client: UserDataRef<Client>, entity_id: i32) -> Result<()> {
client.clone().attack(MinecraftEntityId(entity_id));
while client.get_tick_broadcaster().recv().await.is_ok() {

View File

@@ -8,6 +8,7 @@ use azalea::{
goals::{BlockPosGoal, Goal, RadiusGoal, ReachBlockPosGoal, XZGoal, YGoal},
},
protocol::packets::game::{ServerboundPlayerCommand, s_player_command::Action},
world::MinecraftEntityId,
};
use log::error;
use mlua::{FromLua, Lua, Result, Table, UserDataRef, Value};
@@ -186,7 +187,7 @@ pub fn set_jumping(_lua: &Lua, client: &mut Client, jumping: bool) -> Result<()>
pub fn set_sneaking(_lua: &Lua, client: &Client, sneaking: bool) -> Result<()> {
if let Err(error) = client.write_packet(ServerboundPlayerCommand {
id: client.entity.index(),
id: client.component::<MinecraftEntityId>(),
action: if sneaking {
Action::PressShiftKey
} else {
@@ -215,7 +216,7 @@ pub fn stop_pathfinding(_lua: &Lua, client: &Client, _: ()) -> Result<()> {
pub fn stop_sleeping(_lua: &Lua, client: &Client, _: ()) -> Result<()> {
if let Err(error) = client.write_packet(ServerboundPlayerCommand {
id: client.entity.index(),
id: client.component::<MinecraftEntityId>(),
action: Action::StopSleeping,
data: 0,
}) {