feat(client): add dimension field

This commit is contained in:
Ryan 2025-02-21 22:13:38 -05:00
parent ea7a370715
commit a4606e68e4
Signed by: ErrorNoInternet
GPG Key ID: 2486BFB7B1E6A4A3
2 changed files with 6 additions and 1 deletions

View File

@ -40,6 +40,7 @@ impl UserData for Client {
fn add_fields<F: UserDataFields<Self>>(f: &mut F) {
f.add_field_method_get("air_supply", state::air_supply);
f.add_field_method_get("container", container::container);
f.add_field_method_get("dimension", world::dimension);
f.add_field_method_get("direction", movement::direction);
f.add_field_method_get("eye_position", movement::eye_position);
f.add_field_method_get("has_attack_cooldown", interaction::has_attack_cooldown);

View File

@ -5,7 +5,7 @@ use azalea::{
blocks::{BlockState, BlockStates},
ecs::query::Without,
entity::{Dead, EntityKind, EntityUuid, Position as AzaleaPosition, metadata::CustomName},
world::MinecraftEntityId,
world::{InstanceName, MinecraftEntityId},
};
use mlua::{Function, Lua, Result, Table};
@ -18,6 +18,10 @@ pub fn best_tool_for_block(lua: &Lua, client: &Client, block_state: u16) -> Resu
Ok(tool_result)
}
pub fn dimension(_lua: &Lua, client: &Client) -> Result<String> {
Ok(client.component::<InstanceName>().to_string())
}
pub fn find_blocks(
_lua: &Lua,
client: &Client,