1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

start making metadata use hecs

This commit is contained in:
mat 2022-12-11 17:42:41 -06:00
parent 2813d532e7
commit 767a834bbc
4 changed files with 9094 additions and 8882 deletions

55
Cargo.lock generated
View file

@ -28,6 +28,17 @@ dependencies = [
"cpufeatures",
]
[[package]]
name = "ahash"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
dependencies = [
"getrandom",
"once_cell",
"version_check",
]
[[package]]
name = "ahash"
version = "0.8.2"
@ -274,7 +285,7 @@ dependencies = [
name = "azalea-nbt"
version = "0.5.0"
dependencies = [
"ahash",
"ahash 0.8.2",
"azalea-buf",
"byteorder",
"criterion",
@ -367,6 +378,7 @@ dependencies = [
"azalea-nbt",
"azalea-registry",
"enum-as-inner",
"hecs",
"log",
"nohash-hasher",
"parking_lot",
@ -914,6 +926,9 @@ name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
"ahash 0.7.6",
]
[[package]]
name = "heck"
@ -921,6 +936,29 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"
[[package]]
name = "hecs"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6530b5d25416ece146739e6130f7f7e39f9ee3435236be32b6774f548d76aac"
dependencies = [
"hashbrown",
"hecs-macros",
"lazy_static",
"spin 0.9.4",
]
[[package]]
name = "hecs-macros"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14883fb70dcf2363b5dd2321b9473117d91ebadf211959df748cec6927fd3765"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "hermit-abi"
version = "0.1.19"
@ -1097,6 +1135,9 @@ name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
dependencies = [
"spin 0.5.2",
]
[[package]]
name = "libc"
@ -1816,6 +1857,18 @@ dependencies = [
"winapi",
]
[[package]]
name = "spin"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "spin"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09"
[[package]]
name = "syn"
version = "1.0.105"

View file

@ -9,13 +9,14 @@ version = "0.5.0"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
azalea-block = {path = "../azalea-block", default-features = false, version = "^0.5.0" }
azalea-buf = {path = "../azalea-buf", version = "^0.5.0" }
azalea-chat = {path = "../azalea-chat", version = "^0.5.0" }
azalea-core = {path = "../azalea-core", version = "^0.5.0" }
azalea-nbt = {path = "../azalea-nbt", version = "^0.5.0" }
azalea-registry = {path = "../azalea-registry", version = "^0.5.0" }
azalea-block = {path = "../azalea-block", default-features = false, version = "^0.5.0"}
azalea-buf = {path = "../azalea-buf", version = "^0.5.0"}
azalea-chat = {path = "../azalea-chat", version = "^0.5.0"}
azalea-core = {path = "../azalea-core", version = "^0.5.0"}
azalea-nbt = {path = "../azalea-nbt", version = "^0.5.0"}
azalea-registry = {path = "../azalea-registry", version = "^0.5.0"}
enum-as-inner = "0.5.1"
hecs = {version = "0.9.1", features = ["macros"]}
log = "0.4.17"
nohash-hasher = "0.2.0"
parking_lot = "^0.12.1"

File diff suppressed because it is too large Load diff

View file

@ -90,11 +90,10 @@ async fn handle(mut bot: Client, event: Event, _state: State) -> anyhow::Result<
let Some(sender) = m.username() else {
return Ok(())
};
// let entity = bot
// .world()
// .entity_by(|e| e.kind() == azalea::EntityKind::Player && e.name() ==
// Some(sender));
let entity = None;
let entity = bot
.world()
.entity_by(|e| e.kind() == azalea::EntityKind::Player && e.name() == Some(sender));
// let entity = None;
if let Some(entity) = entity {
if m.content() == "goto" {
let target_pos_vec3 = entity.pos();