Compare commits

..

No commits in common. "3400541a79cb4ee56121439195907eb771deb1dc" and "34dc14d6b272247c29732f884502ea8b09946e2a" have entirely different histories.

4 changed files with 23 additions and 61 deletions

51
Cargo.lock generated
View File

@ -312,7 +312,7 @@ dependencies = [
[[package]]
name = "azalea"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-auth",
"azalea-block",
@ -350,7 +350,7 @@ dependencies = [
[[package]]
name = "azalea-auth"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-crypto",
@ -370,7 +370,7 @@ dependencies = [
[[package]]
name = "azalea-block"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block-macros",
"azalea-buf",
@ -380,7 +380,7 @@ dependencies = [
[[package]]
name = "azalea-block-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -390,7 +390,7 @@ dependencies = [
[[package]]
name = "azalea-brigadier"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-chat",
@ -400,7 +400,7 @@ dependencies = [
[[package]]
name = "azalea-buf"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf-macros",
"byteorder",
@ -414,7 +414,7 @@ dependencies = [
[[package]]
name = "azalea-buf-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -424,7 +424,7 @@ dependencies = [
[[package]]
name = "azalea-chat"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-language",
@ -438,7 +438,7 @@ dependencies = [
[[package]]
name = "azalea-client"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-auth",
"azalea-block",
@ -472,7 +472,7 @@ dependencies = [
[[package]]
name = "azalea-core"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-chat",
@ -489,7 +489,7 @@ dependencies = [
[[package]]
name = "azalea-crypto"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"aes",
"azalea-buf",
@ -506,7 +506,7 @@ dependencies = [
[[package]]
name = "azalea-entity"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block",
"azalea-buf",
@ -527,18 +527,10 @@ dependencies = [
"uuid",
]
[[package]]
name = "azalea-hax"
version = "0.1.0"
source = "git+https://github.com/azalea-rs/azalea-hax#2af9e0759aded7df01770b717f207b3c1083f942"
dependencies = [
"azalea",
]
[[package]]
name = "azalea-inventory"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-chat",
@ -554,7 +546,7 @@ dependencies = [
[[package]]
name = "azalea-inventory-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -564,7 +556,7 @@ dependencies = [
[[package]]
name = "azalea-language"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"compact_str",
"serde",
@ -574,7 +566,7 @@ dependencies = [
[[package]]
name = "azalea-physics"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block",
"azalea-core",
@ -591,7 +583,7 @@ dependencies = [
[[package]]
name = "azalea-protocol"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"async-recursion",
"azalea-auth",
@ -625,7 +617,7 @@ dependencies = [
[[package]]
name = "azalea-protocol-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"proc-macro2",
"quote",
@ -635,7 +627,7 @@ dependencies = [
[[package]]
name = "azalea-registry"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-buf",
"azalea-registry-macros",
@ -646,7 +638,7 @@ dependencies = [
[[package]]
name = "azalea-registry-macros"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"quote",
"syn",
@ -655,7 +647,7 @@ dependencies = [
[[package]]
name = "azalea-world"
version = "0.11.0+mc1.21.4"
source = "git+https://github.com/azalea-rs/azalea#f8130c3c92946d2293634ba4e252d6bc93026c3c"
source = "git+https://github.com/azalea-rs/azalea.git#f8130c3c92946d2293634ba4e252d6bc93026c3c"
dependencies = [
"azalea-block",
"azalea-buf",
@ -1407,7 +1399,6 @@ version = "0.2.0"
dependencies = [
"anyhow",
"azalea",
"azalea-hax",
"bevy_app",
"bevy_ecs",
"bevy_log",

View File

@ -20,8 +20,7 @@ built = { git = "https://github.com/lukaslueg/built", features = ["git2"] }
[dependencies]
anyhow = "1"
azalea = { git = "https://github.com/azalea-rs/azalea" }
azalea-hax = { git = "https://github.com/azalea-rs/azalea-hax" }
azalea = { git = "https://github.com/azalea-rs/azalea.git" }
bevy_app = "0"
bevy_ecs = "0"
bevy_log = "0"

View File

@ -70,7 +70,6 @@ impl UserData for Client {
m.add_method("find_blocks", world::find_blocks);
m.add_method("get_block_state", world::get_block_state);
m.add_method("get_fluid_state", world::get_fluid_state);
m.add_method("set_component", state::set_component);
m.add_method("set_held_slot", container::set_held_slot);
m.add_method("set_mining", interaction::set_mining);
m.add_method("set_position", movement::set_position);

View File

@ -2,12 +2,10 @@ use super::Client;
use azalea::{
ClientInformation,
entity::metadata::{AirSupply, Score},
pathfinder::PathfinderDebugParticles,
protocol::common::client_information::ModelCustomization,
};
use azalea_hax::AntiKnockback;
use log::error;
use mlua::{Error, Lua, Result, Table, UserDataRef};
use mlua::{Lua, Result, Table, UserDataRef};
pub fn air_supply(_lua: &Lua, client: &Client) -> Result<i32> {
Ok(client.component::<AirSupply>().0)
@ -61,28 +59,3 @@ pub async fn set_client_information(
}
Ok(())
}
pub fn set_component(
_lua: &Lua,
client: &Client,
(name, enabled): (String, Option<bool>),
) -> Result<()> {
macro_rules! set {
($name:ident) => {{
let mut ecs = client.ecs.lock();
let mut entity = ecs.entity_mut(client.entity);
if enabled.unwrap_or(true) {
entity.insert($name)
} else {
entity.remove::<$name>()
};
Ok(())
}};
}
match name.as_str() {
"AntiKnockback" => set!(AntiKnockback),
"PathfinderDebugParticles" => set!(PathfinderDebugParticles),
_ => Err(Error::external("invalid component")),
}
}