diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13a81084..c5bb5bac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,6 +46,25 @@ jobs: - name: Run cargo nextest run: cargo nextest run + + deny: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@nightly + + - uses: Swatinem/rust-cache@v2 + + - name: Install cargo-deny + run: cargo install cargo-deny + + - name: Run cargo deny + run: | + cargo deny check + fmt: runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 7109af61..2aa12783 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -88,19 +88,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "async-channel" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" -dependencies = [ - "concurrent-queue", - "event-listener 5.2.0", - "event-listener-strategy 0.5.0", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-executor" version = "1.8.0" @@ -122,7 +109,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener-strategy", "pin-project-lite", ] @@ -140,7 +127,7 @@ checksum = "62f7df18977a1ee03650ee4b31b4aefed6d56bac188760b6e37610400fe8d4bb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -149,132 +136,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "azalea-block" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "azalea-block-macros", - "azalea-buf", - "azalea-registry", -] - -[[package]] -name = "azalea-block-macros" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "azalea-buf" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "azalea-buf-macros", - "byteorder", - "simdnbt", - "thiserror", - "tracing", - "uuid", -] - -[[package]] -name = "azalea-buf-macros" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "azalea-core" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "azalea-buf", - "azalea-inventory", - "azalea-registry", - "bevy_ecs 0.13.1", - "nohash-hasher", - "num-traits", - "serde_json", - "simdnbt", - "tracing", - "uuid", -] - -[[package]] -name = "azalea-inventory" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "azalea-buf", - "azalea-inventory-macros", - "azalea-registry", - "simdnbt", -] - -[[package]] -name = "azalea-inventory-macros" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "azalea-registry" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "azalea-buf", - "azalea-registry-macros", - "once_cell", - "simdnbt", -] - -[[package]] -name = "azalea-registry-macros" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "azalea-world" -version = "0.9.0" -source = "git+https://github.com/azalea-rs/azalea#38bb98707e92747910793669d2f03dc7ee9533fd" -dependencies = [ - "azalea-block", - "azalea-buf", - "azalea-core", - "azalea-inventory", - "azalea-registry", - "bevy_ecs 0.13.1", - "derive_more 0.99.17", - "nohash-hasher", - "once_cell", - "parking_lot", - "rustc-hash", - "serde", - "serde_json", - "simdnbt", - "thiserror", - "tracing", - "uuid", -] - [[package]] name = "backtrace" version = "0.3.71" @@ -315,9 +176,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d41731817993f92e4363dd3335558e779e290bc71eefc0b5547052b85810907e" dependencies = [ "bevy_derive", - "bevy_ecs 0.12.1", - "bevy_tasks 0.12.1", - "bevy_utils 0.12.1", + "bevy_ecs", + "bevy_tasks", + "bevy_utils", "downcast-rs", "wasm-bindgen", "web-sys", @@ -329,9 +190,9 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f484318350462c58ba3942a45a656c1fd6b6e484a6b6b7abc3a787ad1a51e500" dependencies = [ - "bevy_macro_utils 0.12.1", + "bevy_macro_utils", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -340,11 +201,11 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7709fbd22f81fb681534cd913c41e1cd18b17143368743281195d7f024b61aea" dependencies = [ - "async-channel 1.9.0", - "bevy_ecs_macros 0.12.1", - "bevy_ptr 0.12.1", - "bevy_tasks 0.12.1", - "bevy_utils 0.12.1", + "async-channel", + "bevy_ecs_macros", + "bevy_ptr", + "bevy_tasks", + "bevy_utils", "downcast-rs", "event-listener 2.5.3", "fixedbitset", @@ -354,48 +215,16 @@ dependencies = [ "thread_local", ] -[[package]] -name = "bevy_ecs" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a027175613f630a51273c0f8ae909dd54ea3ce72eb573f456056553f79918ac" -dependencies = [ - "async-channel 2.2.0", - "bevy_ecs_macros 0.13.1", - "bevy_ptr 0.13.1", - "bevy_reflect", - "bevy_tasks 0.13.1", - "bevy_utils 0.13.1", - "downcast-rs", - "fixedbitset", - "rustc-hash", - "serde", - "thiserror", - "thread_local", -] - [[package]] name = "bevy_ecs_macros" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8843aa489f159f25cdcd9fee75cd7d221a7098a71eaa72cb2d6b40ac4e3f1ba" dependencies = [ - "bevy_macro_utils 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.55", -] - -[[package]] -name = "bevy_ecs_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55dbbb6300f08cef5983497970db8545d3cbda6ee4f410a6c6742b7b6bbfd3af" -dependencies = [ - "bevy_macro_utils 0.13.1", + "bevy_macro_utils", "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -407,21 +236,8 @@ dependencies = [ "proc-macro2", "quote", "rustc-hash", - "syn 2.0.55", - "toml_edit 0.20.7", -] - -[[package]] -name = "bevy_macro_utils" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bbbf88fc577a21ee9994feed2253ee9838b63fb976783b7a549edfbe07c6764" -dependencies = [ - "proc-macro2", - "quote", - "rustc-hash", - "syn 2.0.55", - "toml_edit 0.21.1", + "syn", + "toml_edit", ] [[package]] @@ -430,47 +246,13 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c77ec20c8fafcdc196508ef5ccb4f0400a8d193cb61f7b14a36ed9a25ad423cf" -[[package]] -name = "bevy_ptr" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea003584000ef02b73800cc7cb62ee74792fff431e6a8df36863c43bf56fb491" - -[[package]] -name = "bevy_reflect" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1101dbd44ae35e5c66802e46cfba1182e49f6163c824bee380d4acab5b2f640" -dependencies = [ - "bevy_ptr 0.13.1", - "bevy_reflect_derive", - "bevy_utils 0.13.1", - "downcast-rs", - "erased-serde", - "serde", - "thiserror", -] - -[[package]] -name = "bevy_reflect_derive" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2a8791d5841a6db862571f709d7ee70c2a5eb1634c3a4329817d04f0e307c2d" -dependencies = [ - "bevy_macro_utils 0.13.1", - "proc-macro2", - "quote", - "syn 2.0.55", - "uuid", -] - [[package]] name = "bevy_tasks" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4fefa7fe0da8923525f7500e274f1bd60dbd79918a25cf7d0dfa0a6ba15c1cf" dependencies = [ - "async-channel 1.9.0", + "async-channel", "async-executor", "async-task", "concurrent-queue", @@ -478,20 +260,6 @@ dependencies = [ "wasm-bindgen-futures", ] -[[package]] -name = "bevy_tasks" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40be36aeec06b8f0eb87894922c6a7fbd8f2a5c8e77dcb9dcbf77641046988c0" -dependencies = [ - "async-channel 2.2.0", - "async-executor", - "async-task", - "concurrent-queue", - "futures-lite 2.3.0", - "wasm-bindgen-futures", -] - [[package]] name = "bevy_utils" version = "0.12.1" @@ -499,7 +267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7915222f4a08ccc782e08d10b751b42e5f9d786e697d0cb3fd09333cb7e8b6ea" dependencies = [ "ahash", - "bevy_utils_proc_macros 0.12.1", + "bevy_utils_proc_macros", "getrandom", "hashbrown", "instant", @@ -510,25 +278,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "bevy_utils" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac758c2e8509a4a260b7a91f920be3beee6ab9e76e388494240ac5d672779159" -dependencies = [ - "ahash", - "bevy_utils_proc_macros 0.13.1", - "getrandom", - "hashbrown", - "nonmax", - "petgraph", - "smallvec 1.13.2", - "thiserror", - "tracing", - "uuid", - "web-time", -] - [[package]] name = "bevy_utils_proc_macros" version = "0.12.1" @@ -537,18 +286,7 @@ checksum = "7aafecc952b6b8eb1a93c12590bd867d25df2f4ae1033a01dfdfc3c35ebccfff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", -] - -[[package]] -name = "bevy_utils_proc_macros" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "014c80f466ed01821a2e602d63cd5076915c1af5de5fa3c074cc4a9ca898ada7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -559,7 +297,7 @@ checksum = "a26b8cea8bb6a81b75a84603b9e096f05fa86db057904ef29be1deee900532bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -686,12 +424,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -760,19 +492,6 @@ dependencies = [ "powerfmt", ] -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "1.0.0-beta.6" @@ -790,7 +509,7 @@ checksum = "2bba3e9872d7c58ce7ef0fcf1844fcc3e23ef2a58377b50df35dd98e42a5726e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -822,15 +541,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "erased-serde" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" -dependencies = [ - "serde", -] - [[package]] name = "evenio" version = "0.4.1" @@ -852,7 +562,7 @@ source = "git+https://github.com/rj00a/evenio#0913f3b23512b2dce58141e3a79428db55 dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -872,17 +582,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "5.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5fb89194fa3cad959b833185b3063ba881dbfc7030680b314250779fb4cc91" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.4.0" @@ -893,16 +592,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" -dependencies = [ - "event-listener 5.2.0", - "pin-project-lite", -] - [[package]] name = "fastrand" version = "1.9.0" @@ -1037,7 +726,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.55", + "syn", ] [[package]] @@ -1335,7 +1024,7 @@ checksum = "176a5f5e69613d9e88337cf2a65e11135332b4efbcc628404a7c555e4452084c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -1360,12 +1049,6 @@ dependencies = [ "pin-utils", ] -[[package]] -name = "nohash-hasher" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" - [[package]] name = "nonmax" version = "0.5.5" @@ -1435,29 +1118,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec 1.13.2", - "windows-targets 0.48.5", -] - [[package]] name = "password-hash" version = "0.4.2" @@ -1534,7 +1194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.55", + "syn", ] [[package]] @@ -1646,30 +1306,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags", -] - -[[package]] -name = "residua-cesu8" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca29b145d9861719b5505602d881afc46705200144153ca9dbc0802be2938ea" - -[[package]] -name = "residua-mutf8" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2adba843a48e520e7dad6d1e9c367a4f818787eaccf4530c6b90dd1f035e630d" -dependencies = [ - "residua-cesu8", -] - [[package]] name = "rustc-demangle" version = "0.1.23" @@ -1682,15 +1318,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "ryu" version = "1.0.17" @@ -1703,12 +1330,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "semver" -version = "1.0.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" - [[package]] name = "serde" version = "1.0.197" @@ -1726,7 +1347,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -1745,7 +1366,6 @@ name = "server" version = "0.1.0" dependencies = [ "anyhow", - "azalea-world", "base64 0.22.0", "bytes", "chunk", @@ -1819,29 +1439,6 @@ dependencies = [ "libc", ] -[[package]] -name = "simdnbt" -version = "0.4.2" -source = "git+https://github.com/azalea-rs/simdnbt#860d6e1b3a50d49b58b2853bf160420cd0b5eafe" -dependencies = [ - "byteorder", - "flate2", - "residua-mutf8", - "simdnbt-derive", - "thiserror", - "valence_nbt 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "simdnbt-derive" -version = "0.4.1" -source = "git+https://github.com/azalea-rs/simdnbt#860d6e1b3a50d49b58b2853bf160420cd0b5eafe" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] - [[package]] name = "slab" version = "0.4.9" @@ -1856,9 +1453,6 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -dependencies = [ - "serde", -] [[package]] name = "smallvec" @@ -1890,17 +1484,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.55" @@ -1929,7 +1512,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -2002,17 +1585,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow", -] - [[package]] name = "tracing" version = "0.1.40" @@ -2032,7 +1604,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -2127,7 +1699,7 @@ source = "git+https://github.com/valence-rs/valence#7e91ca0f6d4608258524052bd521 dependencies = [ "anyhow", "proc-macro2", - "syn 2.0.55", + "syn", ] [[package]] @@ -2164,7 +1736,7 @@ source = "git+https://github.com/valence-rs/valence#7e91ca0f6d4608258524052bd521 dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -2175,16 +1747,6 @@ dependencies = [ "glam", ] -[[package]] -name = "valence_nbt" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3cddc3222ed5ead4fa446881b3deeeee0dba60b0088b2bf12fedbac7eda2312" -dependencies = [ - "byteorder", - "cesu8", -] - [[package]] name = "valence_nbt" version = "0.8.0" @@ -2205,11 +1767,11 @@ source = "git+https://github.com/valence-rs/valence#7e91ca0f6d4608258524052bd521 dependencies = [ "anyhow", "base64 0.21.7", - "bevy_ecs 0.12.1", + "bevy_ecs", "bitfield-struct", "byteorder", "bytes", - "derive_more 1.0.0-beta.6", + "derive_more", "serde", "serde_json", "thiserror", @@ -2219,7 +1781,7 @@ dependencies = [ "valence_generated", "valence_ident", "valence_math", - "valence_nbt 0.8.0 (git+https://github.com/valence-rs/valence)", + "valence_nbt", "valence_protocol_macros", "valence_text", ] @@ -2232,7 +1794,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -2242,13 +1804,13 @@ source = "git+https://github.com/valence-rs/valence#7e91ca0f6d4608258524052bd521 dependencies = [ "anyhow", "bevy_app", - "bevy_ecs 0.12.1", + "bevy_ecs", "indexmap", "serde", "serde_json", "tracing", "valence_ident", - "valence_nbt 0.8.0 (git+https://github.com/valence-rs/valence)", + "valence_nbt", "valence_protocol", "valence_server_common", ] @@ -2259,8 +1821,8 @@ version = "0.2.0-alpha.1+mc.1.20.1" source = "git+https://github.com/valence-rs/valence#7e91ca0f6d4608258524052bd521c5a6cbf221d4" dependencies = [ "bevy_app", - "bevy_ecs 0.12.1", - "derive_more 1.0.0-beta.6", + "bevy_ecs", + "derive_more", "rand 0.8.5", "uuid", "valence_protocol", @@ -2276,7 +1838,7 @@ dependencies = [ "thiserror", "uuid", "valence_ident", - "valence_nbt 0.8.0 (git+https://github.com/valence-rs/valence)", + "valence_nbt", ] [[package]] @@ -2324,7 +1886,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn", "wasm-bindgen-shared", ] @@ -2358,7 +1920,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2379,16 +1941,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-time" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2587,7 +2139,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] @@ -2598,7 +2150,7 @@ checksum = "201585ea96d37ee69f2ac769925ca57160cef31acb137c16f38b02b76f4c1e62" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn", ] [[package]] diff --git a/chunk/Cargo.toml b/chunk/Cargo.toml index 87b55219..649fb32e 100644 --- a/chunk/Cargo.toml +++ b/chunk/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" authors = ["Andrew Gazelka "] readme = "README.md" +publish = false [dependencies] anyhow = "1.0.81" diff --git a/deny.toml b/deny.toml new file mode 100644 index 00000000..53176547 --- /dev/null +++ b/deny.toml @@ -0,0 +1,259 @@ +# This template contains all of the possible sections and their default values + +# Note that all fields that take a lint level have these possible values: +# * deny - An error will be produced and the check will fail +# * warn - A warning will be produced, but the check will not fail +# * allow - No warning or error will be produced, though in some cases a note +# will be + +# The values provided in this template are the default values that will be used +# when any section or field is not specified in your own configuration + +# Root options + +# The graph table configures how the dependency graph is constructed and thus +# which crates the checks are performed against +[graph] +# If 1 or more target triples (and optionally, target_features) are specified, +# only the specified targets will be checked when running `cargo deny check`. +# This means, if a particular package is only ever used as a target specific +# dependency, such as, for example, the `nix` crate only being used via the +# `target_family = "unix"` configuration, that only having windows targets in +# this list would mean the nix crate, as well as any of its exclusive +# dependencies not shared by any other crates, would be ignored, as the target +# list here is effectively saying which targets you are building for. +targets = [ + # The triple can be any string, but only the target triples built in to + # rustc (as of 1.40) can be checked against actual config expressions + #"x86_64-unknown-linux-musl", + # You can also specify which target_features you promise are enabled for a + # particular target. target_features are currently not validated against + # the actual valid features supported by the target architecture. + #{ triple = "wasm32-unknown-unknown", features = ["atomics"] }, +] +# When creating the dependency graph used as the source of truth when checks are +# executed, this field can be used to prune crates from the graph, removing them +# from the view of cargo-deny. This is an extremely heavy hammer, as if a crate +# is pruned from the graph, all of its dependencies will also be pruned unless +# they are connected to another crate in the graph that hasn't been pruned, +# so it should be used with care. The identifiers are [Package ID Specifications] +# (https://doc.rust-lang.org/cargo/reference/pkgid-spec.html) +#exclude = [] +# If true, metadata will be collected with `--all-features`. Note that this can't +# be toggled off if true, if you want to conditionally enable `--all-features` it +# is recommended to pass `--all-features` on the cmd line instead +all-features = false +# If true, metadata will be collected with `--no-default-features`. The same +# caveat with `all-features` applies +no-default-features = false +# If set, these feature will be enabled when collecting metadata. If `--features` +# is specified on the cmd line they will take precedence over this option. +#features = [] + +# The output table provides options for how/if diagnostics are outputted +[output] +# When outputting inclusion graphs in diagnostics that include features, this +# option can be used to specify the depth at which feature edges will be added. +# This option is included since the graphs can be quite large and the addition +# of features from the crate(s) to all of the graph roots can be far too verbose. +# This option can be overridden via `--feature-depth` on the cmd line +feature-depth = 1 + +# This section is considered when running `cargo deny check advisories` +# More documentation for the advisories section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/advisories/cfg.html +[advisories] +# The path where the advisory databases are cloned/fetched into +#db-path = "$CARGO_HOME/advisory-dbs" +# The url(s) of the advisory databases to use +#db-urls = ["https://github.com/rustsec/advisory-db"] +# A list of advisory IDs to ignore. Note that ignored advisories will still +# output a note when they are encountered. +ignore = [ + #"RUSTSEC-0000-0000", + #{ id = "RUSTSEC-0000-0000", reason = "you can specify a reason the advisory is ignored" }, + #"a-crate-that-is-yanked@0.1.1", # you can also ignore yanked crate versions if you wish + #{ crate = "a-crate-that-is-yanked@0.1.1", reason = "you can specify why you are ignoring the yanked crate" }, +] +# If this is true, then cargo deny will use the git executable to fetch advisory database. +# If this is false, then it uses a built-in git library. +# Setting this to true can be helpful if you have special authentication requirements that cargo-deny does not support. +# See Git Authentication for more information about setting up git authentication. +#git-fetch-with-cli = true + +# This section is considered when running `cargo deny check licenses` +# More documentation for the licenses section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html +[licenses] +# List of explicitly allowed licenses +# See https://spdx.org/licenses/ for list of possible licenses +# [possible values: any SPDX 3.11 short identifier (+ optional exception)]. +allow = [ + "MIT", + "Apache-2.0", + "Unicode-DFS-2016", + "BSD-3-Clause" + #"Apache-2.0 WITH LLVM-exception", +] +# The confidence threshold for detecting a license from license text. +# The higher the value, the more closely the license text must be to the +# canonical license text of a valid SPDX license file. +# [possible values: any between 0.0 and 1.0]. +confidence-threshold = 0.8 +# Allow 1 or more licenses on a per-crate basis, so that particular licenses +# aren't accepted for every possible crate as with the normal allow list +exceptions = [ + { allow = ["CC0-1.0"], crate = "constant_time_eq" }, + { allow = ["Zlib"], crate = "nanorand" } + # Each entry is the crate and version constraint, and its specific allow + # list + #{ allow = ["Zlib"], crate = "adler32" }, +] + +# Some crates don't have (easily) machine readable licensing information, +# adding a clarification entry for it allows you to manually specify the +# licensing information +#[[licenses.clarify]] +# The package spec the clarification applies to +#crate = "ring" +# The SPDX expression for the license requirements of the crate +#expression = "MIT AND ISC AND OpenSSL" +# One or more files in the crate's source used as the "source of truth" for +# the license expression. If the contents match, the clarification will be used +# when running the license check, otherwise the clarification will be ignored +# and the crate will be checked normally, which may produce warnings or errors +# depending on the rest of your configuration +#license-files = [ +# Each entry is a crate relative path, and the (opaque) hash of its contents +#{ path = "LICENSE", hash = 0xbd0eed23 } +#] + +[licenses.private] +# If true, ignores workspace crates that aren't published, or are only +# published to private registries. +# To see how to mark a crate as unpublished (to the official registry), +# visit https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish-field. +ignore = true +# One or more private registries that you might publish crates to, if a crate +# is only published to private registries, and ignore is true, the crate will +# not have its license(s) checked +registries = [ + #"https://sekretz.com/registry +] + +# This section is considered when running `cargo deny check bans`. +# More documentation about the 'bans' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html +[bans] +# Lint level for when multiple versions of the same crate are detected +multiple-versions = "warn" +# Lint level for when a crate version requirement is `*` +wildcards = "allow" +# The graph highlighting used when creating dotgraphs for crates +# with multiple versions +# * lowest-version - The path to the lowest versioned duplicate is highlighted +# * simplest-path - The path to the version with the fewest edges is highlighted +# * all - Both lowest-version and simplest-path are used +highlight = "all" +# The default lint level for `default` features for crates that are members of +# the workspace that is being checked. This can be overridden by allowing/denying +# `default` on a crate-by-crate basis if desired. +workspace-default-features = "allow" +# The default lint level for `default` features for external crates that are not +# members of the workspace. This can be overridden by allowing/denying `default` +# on a crate-by-crate basis if desired. +external-default-features = "allow" +# List of crates that are allowed. Use with care! +allow = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is allowed" }, +] +# List of crates to deny +deny = [ + #"ansi_term@0.11.0", + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason it is banned" }, + # Wrapper crates can optionally be specified to allow the crate when it + # is a direct dependency of the otherwise banned crate + #{ crate = "ansi_term@0.11.0", wrappers = ["this-crate-directly-depends-on-ansi_term"] }, +] + +# List of features to allow/deny +# Each entry the name of a crate and a version range. If version is +# not specified, all versions will be matched. +#[[bans.features]] +#crate = "reqwest" +# Features to not allow +#deny = ["json"] +# Features to allow +#allow = [ +# "rustls", +# "__rustls", +# "__tls", +# "hyper-rustls", +# "rustls", +# "rustls-pemfile", +# "rustls-tls-webpki-roots", +# "tokio-rustls", +# "webpki-roots", +#] +# If true, the allowed features must exactly match the enabled feature set. If +# this is set there is no point setting `deny` +#exact = true + +# Certain crates/versions that will be skipped when doing duplicate detection. +skip = [ + "smallvec", + "windows_x86_64_msvc", + "windows_x86_64_gnullvm", + "windows_x86_64_gnu", + "windows_i686_gnu", + "windows_aarch64_msvc", + "windows_i686_msvc", + "windows_aarch64_gnullvm", + "windows-targets", + "windows-targets", + "windows-sys", + "syn", + "futures-lite", + "fastrand", + "event-listener", + "base64" + #{ crate = "ansi_term@0.11.0", reason = "you can specify a reason why it can't be updated/removed" }, +] +# Similarly to `skip` allows you to skip certain crates during duplicate +# detection. Unlike skip, it also includes the entire tree of transitive +# dependencies starting at the specified crate, up to a certain depth, which is +# by default infinite. +skip-tree = [ + #"ansi_term@0.11.0", # will be skipped along with _all_ of its direct and transitive dependencies + #{ crate = "ansi_term@0.11.0", depth = 20 }, +] + +# This section is considered when running `cargo deny check sources`. +# More documentation about the 'sources' section can be found here: +# https://embarkstudios.github.io/cargo-deny/checks/sources/cfg.html +[sources] +# Lint level for what to happen when a crate from a crate registry that is not +# in the allow list is encountered +unknown-registry = "warn" +# Lint level for what to happen when a crate from a git repository that is not +# in the allow list is encountered +unknown-git = "warn" +# List of URLs for allowed crate registries. Defaults to the crates.io index +# if not specified. If it is specified but empty, no registries are allowed. +allow-registry = ["https://github.com/rust-lang/crates.io-index"] +# List of URLs for allowed Git repositories +allow-git = [ + "https://github.com/rj00a/evenio", + "https://github.com/servo/rust-smallvec" +] + +[sources.allow-org] +# 1 or more github.com organizations to allow git sources for +github = [ + "valence-rs", +] +# 1 or more gitlab.com organizations to allow git sources for +gitlab = [] +# 1 or more bitbucket.org organizations to allow git sources for +bitbucket = [] diff --git a/generator-build/Cargo.toml b/generator-build/Cargo.toml index e7567441..729f29df 100644 --- a/generator-build/Cargo.toml +++ b/generator-build/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" authors = ["Andrew Gazelka "] readme = "README.md" +publish = false [dependencies] anyhow = "1.0.81" diff --git a/generator/Cargo.toml b/generator/Cargo.toml index 11c7f046..9035bf22 100644 --- a/generator/Cargo.toml +++ b/generator/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" authors = ["Andrew Gazelka "] readme = "README.md" +publish = false [dependencies] valence_protocol = { git = "https://github.com/valence-rs/valence", optional = true } diff --git a/server/Cargo.toml b/server/Cargo.toml index abb67d0a..9ee8b4ae 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" authors = ["Andrew Gazelka "] readme = "README.md" +publish = false [dependencies] anyhow = "1.0.81" @@ -19,8 +20,6 @@ generator.workspace = true chunk.workspace = true -azalea-world = { git = "https://github.com/azalea-rs/azalea" } - # no secure alloc mimalloc = { version = "0.1.39" , default-features = false } @@ -90,6 +89,7 @@ integer_division_remainder_used = "allow" str_to_string = "allow" missing_assert_message = "allow" multiple_inherent_impl = "allow" +missing_trait_methods = "allow" complexity = { level = "deny", priority = -1 } type_complexity = "allow" diff --git a/server/src/bits.rs b/server/src/bits.rs new file mode 100644 index 00000000..2fdff12c --- /dev/null +++ b/server/src/bits.rs @@ -0,0 +1,268 @@ +#![allow(clippy::indexing_slicing, dead_code)] +// from azalea +use std::{error::Error, fmt}; + +// this is from minecraft's code +// yeah idk either +const MAGIC: [(i32, i32, i32); 64] = [ + (-1, -1, 0), + (-0x8000_0000, 0, 0), + (1_431_655_765, 1_431_655_765, 0), + (-0x8000_0000, 0, 1), + (858_993_459, 858_993_459, 0), + (715_827_882, 715_827_882, 0), + (613_566_756, 613_566_756, 0), + (-0x8000_0000, 0, 2), + (477_218_588, 477_218_588, 0), + (429_496_729, 429_496_729, 0), + (390_451_572, 390_451_572, 0), + (357_913_941, 357_913_941, 0), + (330_382_099, 330_382_099, 0), + (306_783_378, 306_783_378, 0), + (286_331_153, 286_331_153, 0), + (-0x8000_0000, 0, 3), + (0x0F0F_0F0F, 0x0F0F_0F0F, 0), + (238_609_294, 238_609_294, 0), + (226_050_910, 226_050_910, 0), + (214_748_364, 214_748_364, 0), + (204_522_252, 204_522_252, 0), + (195_225_786, 195_225_786, 0), + (186_737_708, 186_737_708, 0), + (178_956_970, 178_956_970, 0), + (171_798_691, 171_798_691, 0), + (165_191_049, 165_191_049, 0), + (159_072_862, 159_072_862, 0), + (153_391_689, 153_391_689, 0), + (148_102_320, 148_102_320, 0), + (143_165_576, 143_165_576, 0), + (138_547_332, 138_547_332, 0), + (-0x8000_0000, 0, 4), + (130_150_524, 130_150_524, 0), + (126_322_567, 126_322_567, 0), + (122_713_351, 122_713_351, 0), + (119_304_647, 119_304_647, 0), + (116_080_197, 116_080_197, 0), + (113_025_455, 113_025_455, 0), + (110_127_366, 110_127_366, 0), + (107_374_182, 107_374_182, 0), + (104_755_299, 104_755_299, 0), + (102_261_126, 102_261_126, 0), + (99_882_960, 99_882_960, 0), + (97_612_893, 97_612_893, 0), + (95_443_717, 95_443_717, 0), + (93_368_854, 93_368_854, 0), + (91_382_282, 91_382_282, 0), + (89_478_485, 89_478_485, 0), + (87_652_393, 87_652_393, 0), + (85_899_345, 85_899_345, 0), + (84_215_045, 84_215_045, 0), + (82_595_524, 82_595_524, 0), + (81_037_118, 81_037_118, 0), + (79_536_431, 79_536_431, 0), + (78_090_314, 78_090_314, 0), + (76_695_844, 76_695_844, 0), + (75_350_303, 75_350_303, 0), + (74_051_160, 74_051_160, 0), + (72_796_055, 72_796_055, 0), + (71_582_788, 71_582_788, 0), + (70_409_299, 70_409_299, 0), + (69_273_666, 69_273_666, 0), + (68_174_084, 68_174_084, 0), + (-0x8000_0000, 0, 5), +]; + +/// A compact list of integers with the given number of bits per entry. +#[derive(Clone, Debug, Default)] +pub struct BitStorage { + data: Vec, + bits: usize, + mask: u64, + size: usize, + values_per_long: usize, + divide_mul: u64, + divide_add: u64, + divide_shift: i32, +} + +#[derive(Debug)] +pub enum BitStorageError { + InvalidLength { got: usize, expected: usize }, +} +impl fmt::Display for BitStorageError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::InvalidLength { got, expected } => write!( + f, + "Invalid length given for storage, got: {got}, but expected: {expected}", + ), + } + } +} +impl Error for BitStorageError {} + +impl BitStorage { + pub fn into_data(self) -> Vec { + self.data + } + + /// Create a new `BitStorage` with the given number of bits per entry. + /// `size` is the number of entries in the `BitStorage`. + pub fn new(bits: usize, size: usize, data: Option>) -> Result { + if let Some(data) = &data { + // 0 bit storage + if data.is_empty() { + return Ok(Self { + data: Vec::new(), + bits, + size, + ..Default::default() + }); + } + } + + debug_assert!((1..=32).contains(&bits)); + + let values_per_long = 64 / bits; + let magic_index = values_per_long - 1; + let (divide_mul, divide_add, divide_shift) = MAGIC[magic_index]; + let calculated_length = (size + values_per_long - 1) / values_per_long; + + let mask = (1 << bits) - 1; + + let using_data = if let Some(data) = data { + if data.len() != calculated_length { + return Err(BitStorageError::InvalidLength { + got: data.len(), + expected: calculated_length, + }); + } + data + } else { + vec![0; calculated_length] + }; + + #[allow(clippy::cast_sign_loss)] + Ok(Self { + data: using_data, + bits, + mask, + size, + values_per_long, + divide_mul: divide_mul as u32 as u64, + divide_add: divide_add as u32 as u64, + divide_shift, + }) + } + + pub const fn cell_index(&self, index: u64) -> usize { + // as unsigned wrap + let first = self.divide_mul; + let second = self.divide_add; + + (((index * first) + second) >> 32 >> self.divide_shift) as usize + } + + /// Get the data at the given index. + /// + /// # Panics + /// + /// This function will panic if the given index is greater than or equal to + /// the size of this storage. + pub fn get(&self, index: usize) -> u64 { + assert!( + index < self.size, + "Index {index} out of bounds (must be less than {})", + self.size + ); + + // 0 bit storage + if self.data.is_empty() { + return 0; + } + + let cell_index = self.cell_index(index as u64); + let cell = &self.data[cell_index]; + let bit_index = (index - cell_index * self.values_per_long) * self.bits; + cell >> bit_index & self.mask + } + + pub fn get_and_set(&mut self, index: usize, value: u64) -> u64 { + // 0 bit storage + if self.data.is_empty() { + return 0; + } + + debug_assert!(index < self.size); + debug_assert!(value <= self.mask); + let cell_index = self.cell_index(index as u64); + let cell = &mut self.data[cell_index]; + let bit_index = (index - cell_index * self.values_per_long) * self.bits; + let old_value = *cell >> (bit_index as u64) & self.mask; + *cell = *cell & !(self.mask << bit_index) | (value & self.mask) << bit_index; + old_value + } + + pub fn set(&mut self, index: usize, value: u64) { + // 0 bit storage + if self.data.is_empty() { + return; + } + + debug_assert!(index < self.size); + debug_assert!(value <= self.mask); + let cell_index = self.cell_index(index as u64); + let cell = &mut self.data[cell_index]; + let bit_index = (index - cell_index * self.values_per_long) * self.bits; + *cell = *cell & !(self.mask << bit_index) | (value & self.mask) << bit_index; + } + + /// The number of entries. + #[inline] + pub const fn size(&self) -> usize { + self.size + } + + pub const fn iter(&self) -> BitStorageIter { + BitStorageIter { + storage: self, + index: 0, + } + } +} + +pub struct BitStorageIter<'a> { + storage: &'a BitStorage, + index: usize, +} + +impl<'a> Iterator for BitStorageIter<'a> { + type Item = u64; + + fn next(&mut self) -> Option { + if self.index >= self.storage.size { + return None; + } + + let value = self.storage.get(self.index); + self.index += 1; + Some(value) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_wikivg_example() { + let data = [ + 1, 2, 2, 3, 4, 4, 5, 6, 6, 4, 8, 0, 7, 4, 3, 13, 15, 16, 9, 14, 10, 12, 0, 2, + ]; + let compact_data: [u64; 2] = [0x0020_8631_4841_8841, 0x0101_8A72_60F6_8C87]; + let storage = BitStorage::new(5, data.len(), Some(compact_data.to_vec())).unwrap(); + + for (i, expected) in data.iter().enumerate() { + assert_eq!(storage.get(i), *expected); + } + } +} diff --git a/server/src/chunk.rs b/server/src/chunk.rs index 28d64acc..4207f8ba 100644 --- a/server/src/chunk.rs +++ b/server/src/chunk.rs @@ -4,7 +4,7 @@ // ceil(log2(height + 1))). The Notchian server also adds a WORLD_SURFACE long array, the purpose of // which is unknown, but it's not required for the chunk to be accepted. -use azalea_world::BitStorage; +use crate::bits::BitStorage; pub const fn ceil_log2(x: u32) -> u32 { u32::BITS - x.leading_zeros() @@ -21,5 +21,5 @@ pub fn heightmap(max_height: u32, current_height: u32) -> Vec { } } - data.data + data.into_data() } diff --git a/server/src/main.rs b/server/src/main.rs index fcad1e33..b45cf204 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -29,6 +29,8 @@ mod handshake; mod packets; mod system; +mod bits; + mod quad_tree; pub mod bounding_box; diff --git a/server/src/system/player_join_world.rs b/server/src/system/player_join_world.rs index c034765c..3a0d4e59 100644 --- a/server/src/system/player_join_world.rs +++ b/server/src/system/player_join_world.rs @@ -1,6 +1,5 @@ use std::{borrow::Cow, io::Write}; -use azalea_world::BitStorage; use chunk::{ bit_width, chunk::{BiomeContainer, BlockStateContainer, SECTION_BLOCK_COUNT}, @@ -22,7 +21,10 @@ use valence_protocol::{ }; use valence_registry::{biome::BiomeId, RegistryIdx}; -use crate::{chunk::heightmap, handshake::Packets, KickPlayer, Player, PlayerJoinWorld, GLOBAL}; +use crate::{ + bits::BitStorage, chunk::heightmap, handshake::Packets, KickPlayer, Player, PlayerJoinWorld, + GLOBAL, +}; pub fn player_join_world( r: Receiver, @@ -285,7 +287,7 @@ fn inner(io: &mut Player) -> anyhow::Result<()> { blocks_and_biomes: &bytes, block_entities: Cow::Borrowed(&[]), - sky_light_mask: Cow::Owned(bits.data), + sky_light_mask: Cow::Owned(bits.into_data()), block_light_mask: Cow::Borrowed(&[]), empty_sky_light_mask: Cow::Borrowed(&[]), empty_block_light_mask: Cow::Borrowed(&[]),