feat(client): add username field

This commit is contained in:
Ryan 2025-03-08 15:31:42 -05:00
parent 225edd5529
commit 9ce39ebb67
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3

View File

@ -55,6 +55,7 @@ impl UserData for Client {
f.add_field_method_get("position", movement::position);
f.add_field_method_get("score", state::score);
f.add_field_method_get("tab_list", tab_list);
f.add_field_method_get("username", username);
f.add_field_method_get("uuid", uuid);
}
@ -115,6 +116,10 @@ fn tab_list(_lua: &Lua, client: &Client) -> Result<Vec<Player>> {
Ok(tab_list)
}
fn username(_lua: &Lua, client: &Client) -> Result<String> {
Ok(client.username())
}
fn uuid(_lua: &Lua, client: &Client) -> Result<String> {
Ok(client.uuid().to_string())
}