aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock298
-rw-r--r--Cargo.toml18
-rw-r--r--azalea-brigadier/tests/bevy_app_usage.rs7
-rw-r--r--azalea-client/src/client.rs8
-rw-r--r--azalea-client/src/plugins/attack.rs3
-rw-r--r--azalea-client/src/plugins/chat/mod.rs11
-rw-r--r--azalea-client/src/plugins/disconnect.rs12
-rw-r--r--azalea-client/src/plugins/events.rs9
-rw-r--r--azalea-client/src/plugins/interact.rs10
-rw-r--r--azalea-client/src/plugins/inventory.rs11
-rw-r--r--azalea-client/src/plugins/login.rs2
-rw-r--r--azalea-client/src/plugins/mining.rs30
-rw-r--r--azalea-client/src/plugins/movement.rs8
-rw-r--r--azalea-client/src/plugins/packet/config/mod.rs6
-rw-r--r--azalea-client/src/plugins/packet/game/mod.rs38
-rw-r--r--azalea-client/src/plugins/packet/login/mod.rs4
-rw-r--r--azalea-client/src/plugins/packet/mod.rs2
-rw-r--r--azalea-client/src/plugins/pong.rs4
-rw-r--r--azalea-client/src/plugins/task_pool.rs2
-rw-r--r--azalea-client/src/test_simulation.rs6
-rw-r--r--azalea-entity/src/plugin/indexing.rs7
-rw-r--r--azalea-entity/src/plugin/relative_updates.rs24
-rw-r--r--azalea-physics/src/lib.rs8
-rw-r--r--azalea-world/src/container.rs2
-rw-r--r--azalea/examples/nearest_entity.rs2
-rw-r--r--azalea/src/auto_respawn.rs2
-rw-r--r--azalea/src/bot.rs3
-rw-r--r--azalea/src/nearest_entity.rs2
-rw-r--r--azalea/src/pathfinder/mod.rs24
-rw-r--r--azalea/src/pathfinder/moves/mod.rs14
-rw-r--r--azalea/src/prelude.rs2
-rw-r--r--azalea/src/swarm/chat.rs9
-rw-r--r--azalea/src/swarm/events.rs2
-rw-r--r--azalea/src/swarm/mod.rs2
34 files changed, 282 insertions, 310 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 71bde4d7..e7153cc7 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -29,20 +29,6 @@ dependencies = [
]
[[package]]
-name = "ahash"
-version = "0.8.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011"
-dependencies = [
- "cfg-if",
- "const-random",
- "getrandom 0.2.16",
- "once_cell",
- "version_check",
- "zerocopy 0.7.35",
-]
-
-[[package]]
name = "aho-corasick"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -52,12 +38,6 @@ dependencies = [
]
[[package]]
-name = "allocator-api2"
-version = "0.2.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923"
-
-[[package]]
name = "android_log-sys"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -202,6 +182,9 @@ name = "async-task"
version = "4.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
+dependencies = [
+ "portable-atomic",
+]
[[package]]
name = "async-trait"
@@ -215,6 +198,15 @@ dependencies = [
]
[[package]]
+name = "atomic-waker"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
+dependencies = [
+ "portable-atomic",
+]
+
+[[package]]
name = "autocfg"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -600,28 +592,32 @@ checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3"
[[package]]
name = "bevy_app"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a0ac033a388b8699d241499a43783a09e6a3bab2430f1297c6bd4974095efb3f"
+checksum = "a2b6267ac23a9947d5b2725ff047a1e1add70076d85fa9fb73d044ab9bea1f3c"
dependencies = [
"bevy_derive",
"bevy_ecs",
+ "bevy_platform",
"bevy_reflect",
"bevy_tasks",
"bevy_utils",
+ "cfg-if",
"console_error_panic_hook",
"ctrlc",
- "derive_more 1.0.0",
"downcast-rs",
+ "log",
+ "thiserror 2.0.12",
+ "variadics_please",
"wasm-bindgen",
"web-sys",
]
[[package]]
name = "bevy_derive"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57d94761ce947b0a2402fd949fe1e7a5b1535293130ba4cd9893be6295d4680a"
+checksum = "f626531b9c05c25a758ede228727bd11c2c2c8498ecbed9925044386d525a2a3"
dependencies = [
"bevy_macro_utils",
"quote",
@@ -630,30 +626,37 @@ dependencies = [
[[package]]
name = "bevy_ecs"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1597106cc01e62e6217ccb662e0748b2ce330893f27c7dc17bac33e0bb99bca9"
+checksum = "d9e807b5d9aab3bb8dfe47e7a44c9ff088bad2ceefe299b80ac77609a87fe9d4"
dependencies = [
+ "arrayvec",
"bevy_ecs_macros",
+ "bevy_platform",
"bevy_ptr",
"bevy_reflect",
"bevy_tasks",
"bevy_utils",
"bitflags",
+ "bumpalo",
"concurrent-queue",
"derive_more 1.0.0",
"disqualified",
"fixedbitset 0.5.7",
+ "indexmap",
+ "log",
"nonmax",
- "petgraph",
+ "serde",
"smallvec",
+ "thiserror 2.0.12",
+ "variadics_please",
]
[[package]]
name = "bevy_ecs_macros"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f453adf07712b39826bc5845e5b0887ce03204ee8359bbe6b40a9afda60564a1"
+checksum = "467d7bb98aeb8dd30f36e6a773000c12a891d4f1bee2adc3841ec89cc8eaf54e"
dependencies = [
"bevy_macro_utils",
"proc-macro2",
@@ -663,14 +666,15 @@ dependencies = [
[[package]]
name = "bevy_log"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b381a22e01f24af51536ef1eace94298dd555d06ffcf368125d16317f5f179cb"
+checksum = "7156df8d2f11135cf71c03eb4c11132b65201fd4f51648571e59e39c9c9ee2f6"
dependencies = [
"android_log-sys",
"bevy_app",
"bevy_ecs",
"bevy_utils",
+ "tracing",
"tracing-log",
"tracing-oslog",
"tracing-subscriber",
@@ -679,10 +683,11 @@ dependencies = [
[[package]]
name = "bevy_macro_utils"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8bb6ded1ddc124ea214f6a2140e47a78d1fe79b0638dad39419cdeef2e1133f1"
+checksum = "7a2473db70d8785b5c75d6dd951a2e51e9be2c2311122db9692c79c9d887517b"
dependencies = [
+ "parking_lot",
"proc-macro2",
"quote",
"syn",
@@ -690,18 +695,37 @@ dependencies = [
]
[[package]]
+name = "bevy_platform"
+version = "0.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "704db2c11b7bc31093df4fbbdd3769f9606a6a5287149f4b51f2680f25834ebc"
+dependencies = [
+ "cfg-if",
+ "critical-section",
+ "foldhash",
+ "getrandom 0.2.16",
+ "hashbrown",
+ "portable-atomic",
+ "portable-atomic-util",
+ "serde",
+ "spin",
+ "web-time",
+]
+
+[[package]]
name = "bevy_ptr"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89fe0b0b919146939481a3a7c38864face2c6d0fd2c73ab3d430dc693ecd9b11"
+checksum = "86f1275dfb4cfef4ffc90c3fa75408964864facf833acc932413d52aa5364ba4"
[[package]]
name = "bevy_reflect"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3ddbca0a39e88eff2c301dc794ee9d73a53f4b08d47b2c9b5a6aac182fae6217"
+checksum = "607ebacc31029cf2f39ac330eabf1d4bc411b159528ec08dbe6b0593eaccfd41"
dependencies = [
"assert_type_match",
+ "bevy_platform",
"bevy_ptr",
"bevy_reflect_derive",
"bevy_utils",
@@ -709,16 +733,22 @@ dependencies = [
"disqualified",
"downcast-rs",
"erased-serde",
+ "foldhash",
+ "glam",
"serde",
"smallvec",
"smol_str",
+ "thiserror 2.0.12",
+ "uuid",
+ "variadics_please",
+ "wgpu-types",
]
[[package]]
name = "bevy_reflect_derive"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d62affb769db17d34ad0b75ff27eca94867e2acc8ea350c5eca97d102bd98709"
+checksum = "cf35e45e4eb239018369f63f2adc2107a54c329f9276d020e01eee1625b0238b"
dependencies = [
"bevy_macro_utils",
"proc-macro2",
@@ -729,56 +759,49 @@ dependencies = [
[[package]]
name = "bevy_tasks"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "028630ddc355563bd567df1076db3515858aa26715ddf7467d2086f9b40e5ab1"
+checksum = "444c450b65e108855f42ecb6db0c041a56ea7d7f10cc6222f0ca95e9536a7d19"
dependencies = [
"async-channel",
"async-executor",
+ "async-task",
+ "atomic-waker",
+ "bevy_platform",
+ "cfg-if",
"concurrent-queue",
+ "crossbeam-queue",
+ "derive_more 1.0.0",
"futures-channel",
"futures-lite",
+ "heapless",
"pin-project",
"wasm-bindgen-futures",
]
[[package]]
name = "bevy_time"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b2051ec56301b994f7c182a2a6eb1490038149ad46d95eee715e1a922acdfd9"
+checksum = "456369ca10f8e039aaf273332744674844827854833ee29e28f9e161702f2f55"
dependencies = [
"bevy_app",
"bevy_ecs",
+ "bevy_platform",
"bevy_reflect",
- "bevy_utils",
"crossbeam-channel",
+ "log",
+ "serde",
]
[[package]]
name = "bevy_utils"
-version = "0.15.3"
+version = "0.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "63c2174d43a0de99f863c98a472370047a2bfa7d1e5cec8d9d647fb500905d9d"
+checksum = "ac2da3b3c1f94dadefcbe837aaa4aa119fcea37f7bdc5307eb05b4ede1921e24"
dependencies = [
- "ahash",
- "bevy_utils_proc_macros",
- "getrandom 0.2.16",
- "hashbrown 0.14.5",
+ "bevy_platform",
"thread_local",
- "tracing",
- "web-time",
-]
-
-[[package]]
-name = "bevy_utils_proc_macros"
-version = "0.15.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94847541f6dd2e28f54a9c2b0e857da5f2631e2201ebc25ce68781cdcb721391"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
]
[[package]]
@@ -806,6 +829,9 @@ name = "bitflags"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
+dependencies = [
+ "serde",
+]
[[package]]
name = "block-buffer"
@@ -999,6 +1025,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
dependencies = [
"crossbeam-utils",
+ "portable-atomic",
]
[[package]]
@@ -1018,26 +1045,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8"
[[package]]
-name = "const-random"
-version = "0.1.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359"
-dependencies = [
- "const-random-macro",
-]
-
-[[package]]
-name = "const-random-macro"
-version = "0.1.16"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e"
-dependencies = [
- "getrandom 0.2.16",
- "once_cell",
- "tiny-keccak",
-]
-
-[[package]]
name = "cpufeatures"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1126,6 +1133,15 @@ dependencies = [
]
[[package]]
+name = "crossbeam-queue"
+version = "0.3.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115"
+dependencies = [
+ "crossbeam-utils",
+]
+
+[[package]]
name = "crossbeam-utils"
version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1245,9 +1261,9 @@ checksum = "c9c272297e804878a2a4b707cfcfc6d2328b5bb936944613b4fdf2b9269afdfd"
[[package]]
name = "downcast-rs"
-version = "1.2.1"
+version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2"
+checksum = "ea8a8b81cacc08888170eef4d13b775126db426d0b348bee9d18c2c1eaf123cf"
[[package]]
name = "either"
@@ -1363,6 +1379,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
+name = "foldhash"
+version = "0.1.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2"
+
+[[package]]
name = "form_urlencoded"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1530,6 +1552,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
[[package]]
+name = "glam"
+version = "0.29.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8babf46d4c1c9d92deac9f7be466f76dfc4482b6452fc5024b5e8daf6ffeb3ee"
+dependencies = [
+ "serde",
+]
+
+[[package]]
name = "glob"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1546,14 +1577,12 @@ dependencies = [
]
[[package]]
-name = "hashbrown"
-version = "0.14.5"
+name = "hash32"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
+checksum = "47d60b12902ba28e2730cd37e95b8c9223af2808df9e902d4df49588d1470606"
dependencies = [
- "ahash",
- "allocator-api2",
- "serde",
+ "byteorder",
]
[[package]]
@@ -1561,6 +1590,21 @@ name = "hashbrown"
version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289"
+dependencies = [
+ "equivalent",
+ "serde",
+]
+
+[[package]]
+name = "heapless"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad"
+dependencies = [
+ "hash32",
+ "portable-atomic",
+ "stable_deref_trait",
+]
[[package]]
name = "heck"
@@ -1872,7 +1916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
dependencies = [
"equivalent",
- "hashbrown 0.15.2",
+ "hashbrown",
]
[[package]]
@@ -2475,7 +2519,7 @@ version = "0.2.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9"
dependencies = [
- "zerocopy 0.8.24",
+ "zerocopy",
]
[[package]]
@@ -3111,6 +3155,9 @@ name = "spin"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
+dependencies = [
+ "portable-atomic",
+]
[[package]]
name = "spki"
@@ -3238,15 +3285,6 @@ dependencies = [
]
[[package]]
-name = "tiny-keccak"
-version = "2.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
-dependencies = [
- "crunchy",
-]
-
-[[package]]
name = "tinystr"
version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3531,13 +3569,15 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "uuid"
-version = "1.12.1"
+version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b"
+checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
dependencies = [
- "getrandom 0.2.16",
+ "getrandom 0.3.2",
+ "js-sys",
"md-5",
"serde",
+ "wasm-bindgen",
]
[[package]]
@@ -3547,6 +3587,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65"
[[package]]
+name = "variadics_please"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "41b6d82be61465f97d42bd1d15bf20f3b0a3a0905018f38f9d6f6962055b0b5c"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
name = "version_check"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3687,6 +3738,19 @@ dependencies = [
]
[[package]]
+name = "wgpu-types"
+version = "24.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "50ac044c0e76c03a0378e7786ac505d010a873665e2d51383dcff8dd227dc69c"
+dependencies = [
+ "bitflags",
+ "js-sys",
+ "log",
+ "serde",
+ "web-sys",
+]
+
+[[package]]
name = "widestring"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4100,31 +4164,11 @@ dependencies = [
[[package]]
name = "zerocopy"
-version = "0.7.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
-dependencies = [
- "zerocopy-derive 0.7.35",
-]
-
-[[package]]
-name = "zerocopy"
version = "0.8.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879"
dependencies = [
- "zerocopy-derive 0.8.24",
-]
-
-[[package]]
-name = "zerocopy-derive"
-version = "0.7.35"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
+ "zerocopy-derive",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index cb76af31..bd61ab74 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -30,14 +30,14 @@ repository = "https://github.com/azalea-rs/azalea"
[workspace.dependencies]
aes = "0.8.4"
-anyhow = "1.0.97"
+anyhow = "1.0.98"
async-recursion = "1.1.1"
base64 = "0.22.1"
-bevy_app = "0.15.3"
-bevy_ecs = { version = "0.15.3", default-features = false }
-bevy_log = "0.15.3"
-bevy_tasks = "0.15.3"
-bevy_time = "0.15.3"
+bevy_app = "0.16.0"
+bevy_ecs = { version = "0.16.0", default-features = false }
+bevy_log = "0.16.0"
+bevy_tasks = "0.16.0"
+bevy_time = "0.16.0"
byteorder = "1.5.0"
cfb8 = "0.8.1"
chrono = { version = "0.4.40", default-features = false }
@@ -54,7 +54,7 @@ nohash-hasher = "0.2.0"
num-bigint = "0.4.6"
num-traits = "0.2.19"
parking_lot = "0.12.3"
-proc-macro2 = "1.0.94"
+proc-macro2 = "1.0.95"
quote = "1.0.40"
rand = "0.8.4"
regex = "1.11.1"
@@ -71,11 +71,11 @@ socks5-impl = "0.6.2"
syn = "2.0.100"
thiserror = "2.0.12"
tokio = "1.44.2"
-tokio-util = "0.7.14"
+tokio-util = "0.7.15"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
hickory-resolver = { version = "0.25.1", default-features = false, git = "https://github.com/hickory-dns/hickory-dns" }
-uuid = "1.12"
+uuid = "1.16"
num-format = "0.4.4"
indexmap = "2.9.0"
paste = "1.0.15"
diff --git a/azalea-brigadier/tests/bevy_app_usage.rs b/azalea-brigadier/tests/bevy_app_usage.rs
index fee541e7..24a2e369 100644
--- a/azalea-brigadier/tests/bevy_app_usage.rs
+++ b/azalea-brigadier/tests/bevy_app_usage.rs
@@ -7,12 +7,7 @@ use azalea_brigadier::{
context::CommandContext,
};
use bevy_app::App;
-use bevy_ecs::{
- component::Component,
- query::With,
- system::{Query, Resource, RunSystemOnce},
- world::{FromWorld, World},
-};
+use bevy_ecs::{prelude::*, system::RunSystemOnce};
use parking_lot::Mutex;
#[test]
diff --git a/azalea-client/src/client.rs b/azalea-client/src/client.rs
index 6937348d..4d803994 100644
--- a/azalea-client/src/client.rs
+++ b/azalea-client/src/client.rs
@@ -32,12 +32,8 @@ use azalea_protocol::{
use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId, PartialInstance};
use bevy_app::{App, Plugin, PluginsState, Update};
use bevy_ecs::{
- bundle::Bundle,
- component::Component,
- entity::Entity,
- schedule::{InternedScheduleLabel, IntoSystemConfigs, LogLevel, ScheduleBuildSettings},
- system::Resource,
- world::World,
+ prelude::*,
+ schedule::{InternedScheduleLabel, LogLevel, ScheduleBuildSettings},
};
use parking_lot::{Mutex, RwLock};
use simdnbt::owned::NbtCompound;
diff --git a/azalea-client/src/plugins/attack.rs b/azalea-client/src/plugins/attack.rs
index c9ecde56..137e3375 100644
--- a/azalea-client/src/plugins/attack.rs
+++ b/azalea-client/src/plugins/attack.rs
@@ -35,7 +35,8 @@ impl Plugin for AttackPlugin {
update_attack_strength_scale.after(PhysicsSet),
handle_attack_queued
.before(super::tick_end::game_tick_packet)
- .after(super::movement::send_sprinting_if_needed),
+ .after(super::movement::send_sprinting_if_needed)
+ .before(super::movement::send_position),
)
.chain(),
);
diff --git a/azalea-client/src/plugins/chat/mod.rs b/azalea-client/src/plugins/chat/mod.rs
index 8562f3ce..7d42eb20 100644
--- a/azalea-client/src/plugins/chat/mod.rs
+++ b/azalea-client/src/plugins/chat/mod.rs
@@ -10,12 +10,7 @@ use azalea_protocol::packets::game::{
c_system_chat::ClientboundSystemChat,
};
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::{
- entity::Entity,
- event::{EventReader, EventWriter},
- prelude::Event,
- schedule::IntoSystemConfigs,
-};
+use bevy_ecs::prelude::*;
use handler::{SendChatKindEvent, handle_send_chat_kind_event};
use uuid::Uuid;
@@ -204,13 +199,13 @@ pub fn handle_send_chat_event(
) {
for event in events.read() {
if event.content.starts_with('/') {
- send_chat_kind_events.send(SendChatKindEvent {
+ send_chat_kind_events.write(SendChatKindEvent {
entity: event.entity,
content: event.content[1..].to_string(),
kind: ChatKind::Command,
});
} else {
- send_chat_kind_events.send(SendChatKindEvent {
+ send_chat_kind_events.write(SendChatKindEvent {
entity: event.entity,
content: event.content.clone(),
kind: ChatKind::Message,
diff --git a/azalea-client/src/plugins/disconnect.rs b/azalea-client/src/plugins/disconnect.rs
index 6b1abdeb..343c25d8 100644
--- a/azalea-client/src/plugins/disconnect.rs
+++ b/azalea-client/src/plugins/disconnect.rs
@@ -3,15 +3,7 @@
use azalea_chat::FormattedText;
use azalea_entity::{EntityBundle, InLoadedChunk, LocalEntity, metadata::PlayerMetadataBundle};
use bevy_app::{App, Plugin, PostUpdate};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::{EventReader, EventWriter},
- prelude::Event,
- query::{Changed, With},
- schedule::IntoSystemConfigs,
- system::{Commands, Query},
-};
+use bevy_ecs::prelude::*;
use derive_more::Deref;
use tracing::info;
@@ -101,7 +93,7 @@ fn disconnect_on_connection_dead(
) {
for (entity, &is_connection_alive) in &query {
if !*is_connection_alive {
- disconnect_events.send(DisconnectEvent {
+ disconnect_events.write(DisconnectEvent {
entity,
reason: None,
});
diff --git a/azalea-client/src/plugins/events.rs b/azalea-client/src/plugins/events.rs
index e92242af..97094db5 100644
--- a/azalea-client/src/plugins/events.rs
+++ b/azalea-client/src/plugins/events.rs
@@ -9,14 +9,7 @@ use azalea_entity::{Dead, InLoadedChunk};
use azalea_protocol::packets::game::c_player_combat_kill::ClientboundPlayerCombatKill;
use azalea_world::{InstanceName, MinecraftEntityId};
use bevy_app::{App, Plugin, PreUpdate, Update};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::EventReader,
- query::{Added, With, Without},
- schedule::IntoSystemConfigs,
- system::{Commands, Query},
-};
+use bevy_ecs::prelude::*;
use derive_more::{Deref, DerefMut};
use tokio::sync::mpsc;
diff --git a/azalea-client/src/plugins/interact.rs b/azalea-client/src/plugins/interact.rs
index 9e638a06..9ca216fb 100644
--- a/azalea-client/src/plugins/interact.rs
+++ b/azalea-client/src/plugins/interact.rs
@@ -19,15 +19,7 @@ use azalea_protocol::packets::game::{
};
use azalea_world::{Instance, InstanceContainer, InstanceName};
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::{Event, EventReader},
- observer::Trigger,
- query::{Changed, With},
- schedule::IntoSystemConfigs,
- system::{Commands, Query, Res},
-};
+use bevy_ecs::prelude::*;
use derive_more::{Deref, DerefMut};
use tracing::warn;
diff --git a/azalea-client/src/plugins/inventory.rs b/azalea-client/src/plugins/inventory.rs
index e6394ab8..0a9c5cad 100644
--- a/azalea-client/src/plugins/inventory.rs
+++ b/azalea-client/src/plugins/inventory.rs
@@ -16,14 +16,7 @@ use azalea_protocol::packets::game::{
};
use azalea_registry::MenuKind;
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- event::EventReader,
- prelude::{Event, EventWriter},
- schedule::{IntoSystemConfigs, SystemSet},
- system::{Commands, Query},
-};
+use bevy_ecs::prelude::*;
use tracing::{error, warn};
use crate::{
@@ -628,7 +621,7 @@ fn handle_container_close_event(
container_id: inventory.id,
},
));
- client_side_events.send(ClientSideCloseContainerEvent {
+ client_side_events.write(ClientSideCloseContainerEvent {
entity: event.entity,
});
}
diff --git a/azalea-client/src/plugins/login.rs b/azalea-client/src/plugins/login.rs
index 385e9651..9a871ac3 100644
--- a/azalea-client/src/plugins/login.rs
+++ b/azalea-client/src/plugins/login.rs
@@ -27,7 +27,7 @@ fn handle_receive_hello_event(trigger: Trigger<ReceiveHelloEvent>, mut commands:
let account = trigger.account.clone();
let packet = trigger.packet.clone();
- let player = trigger.entity();
+ let player = trigger.target();
let task = task_pool.spawn(auth_with_account(account, packet));
commands.entity(player).insert(AuthTask(task));
diff --git a/azalea-client/src/plugins/mining.rs b/azalea-client/src/plugins/mining.rs
index 2dd50700..f4caec41 100644
--- a/azalea-client/src/plugins/mining.rs
+++ b/azalea-client/src/plugins/mining.rs
@@ -127,12 +127,12 @@ fn handle_auto_mine(
))
&& !hit_result_component.miss
{
- start_mining_block_event.send(StartMiningBlockEvent {
+ start_mining_block_event.write(StartMiningBlockEvent {
entity,
position: block_pos,
});
} else if mining.is_some() && hit_result_component.miss {
- stop_mining_block_event.send(StopMiningBlockEvent { entity });
+ stop_mining_block_event.write(StopMiningBlockEvent { entity });
}
}
}
@@ -168,7 +168,7 @@ fn handle_start_mining_block_event(
// we're not looking at the block, arbitrary direction
Direction::Down
};
- start_mining_events.send(StartMiningBlockWithDirectionEvent {
+ start_mining_events.write(StartMiningBlockWithDirectionEvent {
entity: event.entity,
position: event.position,
direction,
@@ -236,7 +236,7 @@ fn handle_start_mining_block_with_direction_event(
if game_mode.current == GameMode::Creative {
*sequence_number += 1;
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity: event.entity,
position: event.position,
});
@@ -283,7 +283,7 @@ fn handle_start_mining_block_with_direction_event(
if block_is_solid && **mine_progress == 0. {
// interact with the block (like note block left click) here
- attack_block_events.send(AttackBlockEvent {
+ attack_block_events.write(AttackBlockEvent {
entity: event.entity,
position: event.position,
});
@@ -303,7 +303,7 @@ fn handle_start_mining_block_with_direction_event(
) >= 1.
{
// block was broken instantly
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity: event.entity,
position: event.position,
});
@@ -316,7 +316,7 @@ fn handle_start_mining_block_with_direction_event(
**current_mining_item = held_item;
**mine_progress = 0.;
**mine_ticks = 0.;
- mine_block_progress_events.send(MineBlockProgressEvent {
+ mine_block_progress_events.write(MineBlockProgressEvent {
entity: event.entity,
position: event.position,
destroy_stage: mine_progress.destroy_stage(),
@@ -502,7 +502,7 @@ pub fn handle_stop_mining_block_event(
));
commands.entity(event.entity).remove::<Mining>();
**mine_progress = 0.;
- mine_block_progress_events.send(MineBlockProgressEvent {
+ mine_block_progress_events.write(MineBlockProgressEvent {
entity: event.entity,
position: mine_block_pos,
destroy_stage: None,
@@ -558,7 +558,7 @@ pub fn continue_mining_block(
if game_mode.current == GameMode::Creative {
// TODO: worldborder check
**mine_delay = 5;
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity,
position: mining.pos,
});
@@ -572,7 +572,7 @@ pub fn continue_mining_block(
sequence: **sequence_number,
},
));
- swing_arm_events.send(SwingArmEvent { entity });
+ swing_arm_events.write(SwingArmEvent { entity });
} else if is_same_mining_target(
mining.pos,
inventory,
@@ -604,7 +604,7 @@ pub fn continue_mining_block(
if **mine_progress >= 1. {
commands.entity(entity).remove::<Mining>();
*sequence_number += 1;
- finish_mining_events.send(FinishMiningBlockEvent {
+ finish_mining_events.write(FinishMiningBlockEvent {
entity,
position: mining.pos,
});
@@ -622,20 +622,20 @@ pub fn continue_mining_block(
**mine_delay = 0;
}
- mine_block_progress_events.send(MineBlockProgressEvent {
+ mine_block_progress_events.write(MineBlockProgressEvent {
entity,
position: mining.pos,
destroy_stage: mine_progress.destroy_stage(),
});
- swing_arm_events.send(SwingArmEvent { entity });
+ swing_arm_events.write(SwingArmEvent { entity });
} else {
- start_mining_events.send(StartMiningBlockWithDirectionEvent {
+ start_mining_events.write(StartMiningBlockWithDirectionEvent {
entity,
position: mining.pos,
direction: mining.dir,
});
}
- swing_arm_events.send(SwingArmEvent { entity });
+ swing_arm_events.write(SwingArmEvent { entity });
}
}
diff --git a/azalea-client/src/plugins/movement.rs b/azalea-client/src/plugins/movement.rs
index f45ead9c..2d844064 100644
--- a/azalea-client/src/plugins/movement.rs
+++ b/azalea-client/src/plugins/movement.rs
@@ -17,13 +17,7 @@ use azalea_protocol::packets::{
};
use azalea_world::{MinecraftEntityId, MoveEntityError};
use bevy_app::{App, Plugin, Update};
-use bevy_ecs::prelude::Event;
-use bevy_ecs::schedule::SystemSet;
-use bevy_ecs::system::Commands;
-use bevy_ecs::{
- component::Component, entity::Entity, event::EventReader, query::With,
- schedule::IntoSystemConfigs, system::Query,
-};
+use bevy_ecs::prelude::*;
use thiserror::Error;
use crate::client::Client;
diff --git a/azalea-client/src/plugins/packet/config/mod.rs b/azalea-client/src/plugins/packet/config/mod.rs
index 9560703b..554135d2 100644
--- a/azalea-client/src/plugins/packet/config/mod.rs
+++ b/azalea-client/src/plugins/packet/config/mod.rs
@@ -82,7 +82,7 @@ impl ConfigPacketHandler<'_> {
pub fn disconnect(&mut self, p: &ClientboundDisconnect) {
warn!("Got disconnect packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(DisconnectEvent {
+ events.write(DisconnectEvent {
entity: self.player,
reason: Some(p.reason.clone()),
});
@@ -124,7 +124,7 @@ impl ConfigPacketHandler<'_> {
);
as_system::<(Commands, EventWriter<_>)>(self.ecs, |(mut commands, mut events)| {
- events.send(KeepAliveEvent {
+ events.write(KeepAliveEvent {
entity: self.player,
id: p.id,
});
@@ -147,7 +147,7 @@ impl ConfigPacketHandler<'_> {
debug!("Got resource pack push packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ResourcePackEvent {
+ events.write(ResourcePackEvent {
entity: self.player,
id: p.id,
url: p.url.to_owned(),
diff --git a/azalea-client/src/plugins/packet/game/mod.rs b/azalea-client/src/plugins/packet/game/mod.rs
index 6235eafd..869a795c 100644
--- a/azalea-client/src/plugins/packet/game/mod.rs
+++ b/azalea-client/src/plugins/packet/game/mod.rs
@@ -249,7 +249,7 @@ impl GamePacketHandler<'_> {
dimension_data.min_y,
&instance_holder.instance.read().registries,
);
- instance_loaded_events.send(InstanceLoadedEvent {
+ instance_loaded_events.write(InstanceLoadedEvent {
entity: self.player,
name: new_instance_name.clone(),
instance: Arc::downgrade(&weak_instance),
@@ -339,7 +339,7 @@ impl GamePacketHandler<'_> {
debug!("Got chunk batch start");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(chunks::ChunkBatchStartEvent {
+ events.write(chunks::ChunkBatchStartEvent {
entity: self.player,
});
});
@@ -349,7 +349,7 @@ impl GamePacketHandler<'_> {
debug!("Got chunk batch finished {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(chunks::ChunkBatchFinishedEvent {
+ events.write(chunks::ChunkBatchFinishedEvent {
entity: self.player,
batch_size: p.batch_size,
});
@@ -390,7 +390,7 @@ impl GamePacketHandler<'_> {
warn!("Got disconnect packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(DisconnectEvent {
+ events.write(DisconnectEvent {
entity: self.player,
reason: Some(p.reason.clone()),
});
@@ -532,7 +532,7 @@ impl GamePacketHandler<'_> {
display_name: updated_info.display_name.clone(),
};
tab_list.insert(updated_info.profile.uuid, info.clone());
- add_player_events.send(AddPlayerEvent {
+ add_player_events.write(AddPlayerEvent {
entity: self.player,
info,
});
@@ -548,7 +548,7 @@ impl GamePacketHandler<'_> {
if p.actions.update_display_name {
info.display_name.clone_from(&updated_info.display_name);
}
- update_player_events.send(UpdatePlayerEvent {
+ update_player_events.write(UpdatePlayerEvent {
entity: self.player,
info: info.clone(),
});
@@ -577,7 +577,7 @@ impl GamePacketHandler<'_> {
for uuid in &p.profile_ids {
if let Some(info) = tab_list.remove(uuid) {
- remove_player_events.send(RemovePlayerEvent {
+ remove_player_events.write(RemovePlayerEvent {
entity: self.player,
info,
});
@@ -611,7 +611,7 @@ impl GamePacketHandler<'_> {
debug!("Got chunk with light packet {} {}", p.x, p.z);
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(chunks::ReceiveChunkEvent {
+ events.write(chunks::ReceiveChunkEvent {
entity: self.player,
packet: p.clone(),
});
@@ -1032,7 +1032,7 @@ impl GamePacketHandler<'_> {
as_system::<(EventWriter<KeepAliveEvent>, Commands)>(
self.ecs,
|(mut keepalive_events, mut commands)| {
- keepalive_events.send(KeepAliveEvent {
+ keepalive_events.write(KeepAliveEvent {
entity: self.player,
id: p.id,
});
@@ -1084,7 +1084,7 @@ impl GamePacketHandler<'_> {
debug!("Got player chat packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ChatReceivedEvent {
+ events.write(ChatReceivedEvent {
entity: self.player,
packet: ChatPacket::Player(Arc::new(p.clone())),
});
@@ -1095,7 +1095,7 @@ impl GamePacketHandler<'_> {
debug!("Got system chat packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ChatReceivedEvent {
+ events.write(ChatReceivedEvent {
entity: self.player,
packet: ChatPacket::System(Arc::new(p.clone())),
});
@@ -1106,7 +1106,7 @@ impl GamePacketHandler<'_> {
debug!("Got disguised chat packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ChatReceivedEvent {
+ events.write(ChatReceivedEvent {
entity: self.player,
packet: ChatPacket::Disguised(Arc::new(p.clone())),
});
@@ -1217,7 +1217,7 @@ impl GamePacketHandler<'_> {
}
}
} else {
- events.send(SetContainerContentEvent {
+ events.write(SetContainerContentEvent {
entity: self.player,
slots: p.items.clone(),
container_id: p.container_id,
@@ -1283,7 +1283,7 @@ impl GamePacketHandler<'_> {
debug!("Got container close packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ClientSideCloseContainerEvent {
+ events.write(ClientSideCloseContainerEvent {
entity: self.player,
});
});
@@ -1300,7 +1300,7 @@ impl GamePacketHandler<'_> {
as_system::<EventWriter<_>>(self.ecs, |mut knockback_events| {
if let Some(knockback) = p.knockback {
- knockback_events.send(KnockbackEvent {
+ knockback_events.write(KnockbackEvent {
entity: self.player,
knockback: KnockbackType::Set(knockback),
});
@@ -1334,7 +1334,7 @@ impl GamePacketHandler<'_> {
debug!("Got open screen packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(MenuOpenedEvent {
+ events.write(MenuOpenedEvent {
entity: self.player,
window_id: p.container_id,
menu_type: p.menu_type,
@@ -1371,7 +1371,7 @@ impl GamePacketHandler<'_> {
if *entity_id == p.player_id && dead.is_none() {
commands.entity(self.player).insert(Dead);
- events.send(DeathEvent {
+ events.write(DeathEvent {
entity: self.player,
packet: Some(p.clone()),
});
@@ -1387,7 +1387,7 @@ impl GamePacketHandler<'_> {
debug!("Got resource pack packet {p:?}");
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(ResourcePackEvent {
+ events.write(ResourcePackEvent {
entity: self.player,
id: p.id,
url: p.url.to_owned(),
@@ -1439,7 +1439,7 @@ impl GamePacketHandler<'_> {
dimension_data.min_y,
&instance_holder.instance.read().registries,
);
- events.send(InstanceLoadedEvent {
+ events.write(InstanceLoadedEvent {
entity: self.player,
name: new_instance_name.clone(),
instance: Arc::downgrade(&weak_instance),
diff --git a/azalea-client/src/plugins/packet/login/mod.rs b/azalea-client/src/plugins/packet/login/mod.rs
index d313a767..3dad17ab 100644
--- a/azalea-client/src/plugins/packet/login/mod.rs
+++ b/azalea-client/src/plugins/packet/login/mod.rs
@@ -72,7 +72,7 @@ impl LoginPacketHandler<'_> {
debug!("Got disconnect {:?}", p);
as_system::<EventWriter<_>>(self.ecs, |mut events| {
- events.send(DisconnectEvent {
+ events.write(DisconnectEvent {
entity: self.player,
reason: Some(p.reason.clone()),
});
@@ -121,7 +121,7 @@ impl LoginPacketHandler<'_> {
debug!("Got custom query {p:?}");
as_system::<EventWriter<ReceiveCustomQueryEvent>>(self.ecs, |mut events| {
- events.send(ReceiveCustomQueryEvent {
+ events.write(ReceiveCustomQueryEvent {
entity: self.player,
packet: p.clone(),
disabled: false,
diff --git a/azalea-client/src/plugins/packet/mod.rs b/azalea-client/src/plugins/packet/mod.rs
index 1c14fa30..0abf43cc 100644
--- a/azalea-client/src/plugins/packet/mod.rs
+++ b/azalea-client/src/plugins/packet/mod.rs
@@ -20,7 +20,7 @@ pub fn death_event_on_0_health(
) {
for (entity, health) in query.iter() {
if **health == 0. {
- death_events.send(DeathEvent {
+ death_events.write(DeathEvent {
entity,
packet: None,
});
diff --git a/azalea-client/src/plugins/pong.rs b/azalea-client/src/plugins/pong.rs
index 827ddfb1..e23b5245 100644
--- a/azalea-client/src/plugins/pong.rs
+++ b/azalea-client/src/plugins/pong.rs
@@ -24,14 +24,14 @@ impl Plugin for PongPlugin {
pub fn reply_to_game_ping(trigger: Trigger<PingEvent>, mut commands: Commands) {
commands.trigger(SendPacketEvent::new(
- trigger.entity(),
+ trigger.target(),
azalea_protocol::packets::game::ServerboundPong { id: trigger.0.id },
));
}
pub fn reply_to_config_ping(trigger: Trigger<ConfigPingEvent>, mut commands: Commands) {
commands.trigger(SendConfigPacketEvent::new(
- trigger.entity(),
+ trigger.target(),
azalea_protocol::packets::config::ServerboundPong { id: trigger.0.id },
));
}
diff --git a/azalea-client/src/plugins/task_pool.rs b/azalea-client/src/plugins/task_pool.rs
index ab56bf69..56ebc7cf 100644
--- a/azalea-client/src/plugins/task_pool.rs
+++ b/azalea-client/src/plugins/task_pool.rs
@@ -3,7 +3,7 @@
use std::marker::PhantomData;
use bevy_app::{App, Last, Plugin};
-use bevy_ecs::system::{NonSend, Resource};
+use bevy_ecs::prelude::*;
use bevy_tasks::{
AsyncComputeTaskPool, ComputeTaskPool, IoTaskPool, TaskPoolBuilder,
tick_global_task_pools_on_main_thread,
diff --git a/azalea-client/src/test_simulation.rs b/azalea-client/src/test_simulation.rs
index 4dec01b4..53e4110e 100644
--- a/azalea-client/src/test_simulation.rs
+++ b/azalea-client/src/test_simulation.rs
@@ -20,6 +20,7 @@ use azalea_registry::{DimensionType, EntityKind};
use azalea_world::palette::{PalettedContainer, PalettedContainerKind};
use azalea_world::{Chunk, Instance, MinecraftEntityId, Section};
use bevy_app::App;
+use bevy_ecs::component::Mutable;
use bevy_ecs::{prelude::*, schedule::ExecutorKind};
use parking_lot::RwLock;
use simdnbt::owned::{NbtCompound, NbtTag};
@@ -109,7 +110,10 @@ impl Simulation {
pub fn has_component<T: Component>(&self) -> bool {
self.app.world().get::<T>(self.entity).is_some()
}
- pub fn with_component_mut<T: Component>(&mut self, f: impl FnOnce(&mut T)) {
+ pub fn with_component_mut<T: Component<Mutability = Mutable>>(
+ &mut self,
+ f: impl FnOnce(&mut T),
+ ) {
f(&mut self
.app
.world_mut()
diff --git a/azalea-entity/src/plugin/indexing.rs b/azalea-entity/src/plugin/indexing.rs
index 2a7643b0..a91e6b6d 100644
--- a/azalea-entity/src/plugin/indexing.rs
+++ b/azalea-entity/src/plugin/indexing.rs
@@ -7,12 +7,7 @@ use std::{
use azalea_core::position::ChunkPos;
use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId};
-use bevy_ecs::{
- component::Component,
- entity::Entity,
- query::{Added, Changed, Without},
- system::{Commands, Query, Res, ResMut, Resource},
-};
+use bevy_ecs::prelude::*;
use derive_more::{Deref, DerefMut};
use nohash_hasher::IntMap;
use tracing::{debug, trace, warn};
diff --git a/azalea-entity/src/plugin/relative_updates.rs b/azalea-entity/src/plugin/relative_updates.rs
index 5ad7d7a0..1c0a899f 100644
--- a/azalea-entity/src/plugin/relative_updates.rs
+++ b/azalea-entity/src/plugin/relative_updates.rs
@@ -18,12 +18,7 @@
use std::sync::Arc;
use azalea_world::{MinecraftEntityId, PartialInstance};
-use bevy_ecs::{
- prelude::{Component, Entity},
- query::With,
- system::{EntityCommand, Query},
- world::{EntityWorldMut, World},
-};
+use bevy_ecs::prelude::*;
use derive_more::{Deref, DerefMut};
use parking_lot::RwLock;
use tracing::warn;
@@ -68,19 +63,17 @@ impl RelativeEntityUpdate {
pub struct UpdatesReceived(u32);
impl EntityCommand for RelativeEntityUpdate {
- fn apply(self, entity: Entity, world: &mut World) {
+ fn apply(self, mut entity: EntityWorldMut) {
let partial_entity_infos = &mut self.partial_world.write().entity_infos;
- let mut entity_mut = world.entity_mut(entity);
-
- if Some(entity) == partial_entity_infos.owner_entity {
+ if Some(entity.id()) == partial_entity_infos.owner_entity {
// if the entity owns this partial world, it's always allowed to update itself
- (self.update)(&mut entity_mut);
+ (self.update)(&mut entity);
return;
};
- let entity_id = *entity_mut.get::<MinecraftEntityId>().unwrap();
- if entity_mut.contains::<LocalEntity>() {
+ let entity_id = *entity.get::<MinecraftEntityId>().unwrap();
+ if entity.contains::<LocalEntity>() {
// a client tried to update another client, which isn't allowed
return;
}
@@ -90,7 +83,7 @@ impl EntityCommand for RelativeEntityUpdate {
.get(&entity_id)
.copied();
- let can_update = if let Some(updates_received) = entity_mut.get::<UpdatesReceived>() {
+ let can_update = if let Some(updates_received) = entity.get::<UpdatesReceived>() {
this_client_updates_received.unwrap_or(1) == **updates_received
} else {
// no UpdatesReceived means the entity was just spawned
@@ -102,9 +95,8 @@ impl EntityCommand for RelativeEntityUpdate {
.updates_received
.insert(entity_id, new_updates_received);
- entity_mut.insert(UpdatesReceived(new_updates_received));
+ entity.insert(UpdatesReceived(new_updates_received));
- let mut entity = world.entity_mut(entity);
(self.update)(&mut entity);
}
}
diff --git a/azalea-physics/src/lib.rs b/azalea-physics/src/lib.rs
index c1603710..6c9fe096 100644
--- a/azalea-physics/src/lib.rs
+++ b/azalea-physics/src/lib.rs
@@ -20,13 +20,7 @@ use azalea_entity::{
};
use azalea_world::{Instance, InstanceContainer, InstanceName};
use bevy_app::{App, Plugin};
-use bevy_ecs::{
- entity::Entity,
- query::With,
- schedule::{IntoSystemConfigs, SystemSet},
- system::{Query, Res},
- world::Mut,
-};
+use bevy_ecs::prelude::*;
use clip::box_traverse_blocks;
use collision::{
BLOCK_SHAPE, BlockWithShape, MoverType, VoxelShape,
diff --git a/azalea-world/src/container.rs b/azalea-world/src/container.rs
index 8648d19e..6e3c18d3 100644
--- a/azalea-world/src/container.rs
+++ b/azalea-world/src/container.rs
@@ -4,7 +4,7 @@ use std::{
};
use azalea_core::{registry_holder::RegistryHolder, resource_location::ResourceLocation};
-use bevy_ecs::{component::Component, system::Resource};
+use bevy_ecs::{component::Component, resource::Resource};
use derive_more::{Deref, DerefMut};
use nohash_hasher::IntMap;
use parking_lot::RwLock;
diff --git a/azalea/examples/nearest_entity.rs b/azalea/examples/nearest_entity.rs
index 911f9f58..1fb6bdd1 100644
--- a/azalea/examples/nearest_entity.rs
+++ b/azalea/examples/nearest_entity.rs
@@ -48,7 +48,7 @@ fn look_at_everything(
look_target.y += **eye_height as f64;
}
- look_at_event.send(LookAtEvent {
+ look_at_event.write(LookAtEvent {
entity: bot_id,
position: look_target,
});
diff --git a/azalea/src/auto_respawn.rs b/azalea/src/auto_respawn.rs
index 0d878595..6e970a71 100644
--- a/azalea/src/auto_respawn.rs
+++ b/azalea/src/auto_respawn.rs
@@ -26,7 +26,7 @@ fn auto_respawn(
mut perform_respawn_events: EventWriter<PerformRespawnEvent>,
) {
for event in events.read() {
- perform_respawn_events.send(PerformRespawnEvent {
+ perform_respawn_events.write(PerformRespawnEvent {
entity: event.entity,
});
}
diff --git a/azalea/src/bot.rs b/azalea/src/bot.rs
index dd8e6209..bca0174b 100644
--- a/azalea/src/bot.rs
+++ b/azalea/src/bot.rs
@@ -11,8 +11,7 @@ use azalea_entity::{
};
use azalea_physics::PhysicsSet;
use bevy_app::Update;
-use bevy_ecs::prelude::Event;
-use bevy_ecs::schedule::IntoSystemConfigs;
+use bevy_ecs::prelude::*;
use futures_lite::Future;
use tracing::trace;
diff --git a/azalea/src/nearest_entity.rs b/azalea/src/nearest_entity.rs
index 867e3fe8..aa6c6e6f 100644
--- a/azalea/src/nearest_entity.rs
+++ b/azalea/src/nearest_entity.rs
@@ -34,7 +34,7 @@ use bevy_ecs::{
/// continue;
/// };
///
-/// chat_events.send(SendChatEvent {
+/// chat_events.write(SendChatEvent {
/// entity: bot_id,
/// content: String::from("Ahhh!"),
/// });
diff --git a/azalea/src/pathfinder/mod.rs b/azalea/src/pathfinder/mod.rs
index c747ef67..aba8610a 100644
--- a/azalea/src/pathfinder/mod.rs
+++ b/azalea/src/pathfinder/mod.rs
@@ -32,9 +32,7 @@ use azalea_entity::{Physics, Position};
use azalea_physics::PhysicsSet;
use azalea_world::{InstanceContainer, InstanceName};
use bevy_app::{PreUpdate, Update};
-use bevy_ecs::prelude::Event;
-use bevy_ecs::query::Changed;
-use bevy_ecs::schedule::IntoSystemConfigs;
+use bevy_ecs::prelude::*;
use bevy_tasks::{AsyncComputeTaskPool, Task};
use futures_lite::future;
use goals::BlockPosGoal;
@@ -477,7 +475,7 @@ pub fn handle_tasks(
for (entity, mut task) in &mut transform_tasks {
if let Some(optional_path_found_event) = future::block_on(future::poll_once(&mut task.0)) {
if let Some(path_found_event) = optional_path_found_event {
- path_found_events.send(path_found_event);
+ path_found_events.write(path_found_event);
}
// Task is complete, so remove task component from entity
@@ -698,7 +696,7 @@ pub fn check_node_reached(
if executing_path.path.is_empty() {
info!("the path we just swapped to was empty, so reached end of path");
- walk_events.send(StartWalkEvent {
+ walk_events.write(StartWalkEvent {
entity,
direction: WalkDirection::None,
});
@@ -712,7 +710,7 @@ pub fn check_node_reached(
if executing_path.path.is_empty() {
debug!("pathfinder path is now empty");
- walk_events.send(StartWalkEvent {
+ walk_events.write(StartWalkEvent {
entity,
direction: WalkDirection::None,
});
@@ -923,7 +921,7 @@ pub fn recalculate_near_end_of_path(
"recalculate_near_end_of_path executing_path.is_path_partial: {}",
executing_path.is_path_partial
);
- goto_events.send(GotoEvent {
+ goto_events.write(GotoEvent {
entity,
goal,
successors_fn,
@@ -947,7 +945,7 @@ pub fn recalculate_near_end_of_path(
info!(
"the path we just swapped to was empty, so reached end of path"
);
- walk_events.send(StartWalkEvent {
+ walk_events.write(StartWalkEvent {
entity,
direction: WalkDirection::None,
});
@@ -955,7 +953,7 @@ pub fn recalculate_near_end_of_path(
break;
}
} else {
- walk_events.send(StartWalkEvent {
+ walk_events.write(StartWalkEvent {
entity,
direction: WalkDirection::None,
});
@@ -966,7 +964,7 @@ pub fn recalculate_near_end_of_path(
_ => {
if executing_path.path.is_empty() {
// idk when this can happen but stop moving just in case
- walk_events.send(StartWalkEvent {
+ walk_events.write(StartWalkEvent {
entity,
direction: WalkDirection::None,
});
@@ -1033,7 +1031,7 @@ pub fn recalculate_if_has_goal_but_no_path(
if pathfinder.goal.is_some() && !pathfinder.is_calculating {
if let Some(goal) = pathfinder.goal.as_ref().cloned() {
debug!("Recalculating path because it has a goal but no ExecutingPath");
- goto_events.send(GotoEvent {
+ goto_events.write(GotoEvent {
entity,
goal,
successors_fn: pathfinder.successors_fn.unwrap(),
@@ -1081,7 +1079,7 @@ pub fn handle_stop_pathfinding_event(
}
if executing_path.path.is_empty() {
- walk_events.send(StartWalkEvent {
+ walk_events.write(StartWalkEvent {
entity: event.entity,
direction: WalkDirection::None,
});
@@ -1098,7 +1096,7 @@ pub fn stop_pathfinding_on_instance_change(
if !executing_path.path.is_empty() {
debug!("instance changed, clearing path");
executing_path.path.clear();
- stop_pathfinding_events.send(StopPathfindingEvent {
+ stop_pathfinding_events.write(StopPathfindingEvent {
entity,
force: true,
});
diff --git a/azalea/src/pathfinder/moves/mod.rs b/azalea/src/pathfinder/moves/mod.rs
index 83e6369f..150dad52 100644
--- a/azalea/src/pathfinder/moves/mod.rs
+++ b/azalea/src/pathfinder/moves/mod.rs
@@ -68,7 +68,7 @@ pub struct ExecuteCtx<'w1, 'w2, 'w3, 'w4, 'w5, 'w6, 'a> {
impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_> {
pub fn look_at(&mut self, position: Vec3) {
- self.look_at_events.send(LookAtEvent {
+ self.look_at_events.write(LookAtEvent {
entity: self.entity,
position: Vec3 {
x: position.x,
@@ -80,28 +80,28 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_> {
}
pub fn look_at_exact(&mut self, position: Vec3) {
- self.look_at_events.send(LookAtEvent {
+ self.look_at_events.write(LookAtEvent {
entity: self.entity,
position,
});
}
pub fn sprint(&mut self, direction: SprintDirection) {
- self.sprint_events.send(StartSprintEvent {
+ self.sprint_events.write(StartSprintEvent {
entity: self.entity,
direction,
});
}
pub fn walk(&mut self, direction: WalkDirection) {
- self.walk_events.send(StartWalkEvent {
+ self.walk_events.write(StartWalkEvent {
entity: self.entity,
direction,
});
}
pub fn jump(&mut self) {
- self.jump_events.send(JumpEvent {
+ self.jump_events.write(JumpEvent {
entity: self.entity,
});
}
@@ -137,7 +137,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_> {
let best_tool_result = best_tool_in_hotbar_for_block(block_state, &self.menu);
self.set_selected_hotbar_slot_events
- .send(SetSelectedHotbarSlotEvent {
+ .write(SetSelectedHotbarSlotEvent {
entity: self.entity,
slot: best_tool_result.index as u8,
});
@@ -146,7 +146,7 @@ impl ExecuteCtx<'_, '_, '_, '_, '_, '_, '_> {
self.walk(WalkDirection::None);
self.look_at_exact(block.center());
- self.start_mining_events.send(StartMiningBlockEvent {
+ self.start_mining_events.write(StartMiningBlockEvent {
entity: self.entity,
position: block,
});
diff --git a/azalea/src/prelude.rs b/azalea/src/prelude.rs
index 4f68f1ea..648fad6a 100644
--- a/azalea/src/prelude.rs
+++ b/azalea/src/prelude.rs
@@ -6,7 +6,7 @@ pub use azalea_core::tick::GameTick;
// this is necessary to make the macros that reference bevy_ecs work
pub use crate::ecs as bevy_ecs;
-pub use crate::ecs::{component::Component, system::Resource};
+pub use crate::ecs::{component::Component, resource::Resource};
pub use crate::{
ClientBuilder, bot::BotClientExt, container::ContainerClientExt,
pathfinder::PathfinderClientExt,
diff --git a/azalea/src/swarm/chat.rs b/azalea/src/swarm/chat.rs
index f56c1511..21db2fd8 100644
--- a/azalea/src/swarm/chat.rs
+++ b/azalea/src/swarm/chat.rs
@@ -20,12 +20,7 @@ use bevy_app::{App, Plugin, Update};
use bevy_ecs::prelude::Event;
use super::{Swarm, SwarmEvent};
-use crate::ecs::{
- component::Component,
- event::{EventReader, EventWriter},
- schedule::IntoSystemConfigs,
- system::{Commands, Query, Res, ResMut, Resource},
-};
+use crate::ecs::prelude::*;
#[derive(Clone)]
pub struct SwarmChatPlugin;
@@ -99,7 +94,7 @@ fn chat_listener(
if !found {
// didn't find the message, so fire the swarm event and add to the queue
- new_chat_messages_events.send(NewChatMessageEvent(event.packet.clone()));
+ new_chat_messages_events.write(NewChatMessageEvent(event.packet.clone()));
global_chat_state.chat_queue.push_back(event.packet.clone());
client_chat_index =
global_chat_state.chat_queue.len() + global_chat_state.chat_min_index;
diff --git a/azalea/src/swarm/events.rs b/azalea/src/swarm/events.rs
index d6f69157..b8154c50 100644
--- a/azalea/src/swarm/events.rs
+++ b/azalea/src/swarm/events.rs
@@ -38,5 +38,5 @@ fn check_ready(
// all the players are in the world, so we're ready
**is_swarm_ready = true;
- ready_events.send(SwarmReadyEvent);
+ ready_events.write(SwarmReadyEvent);
}
diff --git a/azalea/src/swarm/mod.rs b/azalea/src/swarm/mod.rs
index 9be5d7ea..2e33148e 100644
--- a/azalea/src/swarm/mod.rs
+++ b/azalea/src/swarm/mod.rs
@@ -24,7 +24,7 @@ use azalea_client::{
use azalea_protocol::{ServerAddress, resolver};
use azalea_world::InstanceContainer;
use bevy_app::{App, PluginGroup, PluginGroupBuilder, Plugins};
-use bevy_ecs::{component::Component, entity::Entity, system::Resource, world::World};
+use bevy_ecs::prelude::*;
use futures::future::{BoxFuture, join_all};
use parking_lot::{Mutex, RwLock};
use tokio::sync::mpsc;