fix(client): handle borrows with async

This commit is contained in:
2026-04-13 13:58:58 -04:00
parent d6c16f0d5d
commit 57397d3718
7 changed files with 84 additions and 50 deletions

View File

@@ -6,6 +6,7 @@ use azalea_hax::AntiKnockback;
use mlua::{Error, Lua, Result, Table, UserDataRef};
use super::Client;
use crate::unpack;
pub fn air_supply(_lua: &Lua, client: &Client) -> Result<i32> {
Ok(client.component::<AirSupply>().0)
@@ -37,6 +38,8 @@ pub async fn set_client_information(
client: UserDataRef<Client>,
info: Table,
) -> Result<()> {
let client = unpack!(client);
let get_bool = |table: &Table, name| table.get(name).unwrap_or(true);
client.set_client_information(ClientInformation {
allows_listing: info.get("allows_listing")?,