feat(client): add dimension field
This commit is contained in:
parent
ea7a370715
commit
a4606e68e4
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user