diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index aabd450e2..000000000 --- a/Cargo.lock +++ /dev/null @@ -1,2312 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - -[[package]] -name = "autocfg" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" - -[[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" -dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets 0.52.6", -] - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.11.0-rc.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "939c0e62efa052fb0b2db2c0f7c479ad32e364c192c3aab605a7641de265a1a7" -dependencies = [ - "hybrid-array", -] - -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" - -[[package]] -name = "cc" -version = "1.1.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" -dependencies = [ - "shlex", -] - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cfb8" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "014c0a0e1ad0dae6a86c082db2f9bd7fe8c2c734227047d0d8b4d4a3a094a1e1" -dependencies = [ - "cipher", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common 0.1.6", - "inout", -] - -[[package]] -name = "colored" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" -dependencies = [ - "lazy_static", - "windows-sys 0.48.0", -] - -[[package]] -name = "const-oid" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" - -[[package]] -name = "convert_case" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - -[[package]] -name = "cpufeatures" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "crypto-common" -version = "0.2.0-rc.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b8ce8218c97789f16356e7896b3714f26c2ee1079b79c0b7ae7064bb9089fa" -dependencies = [ - "hybrid-array", -] - -[[package]] -name = "ctrlc" -version = "3.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3" -dependencies = [ - "nix", - "windows-sys 0.59.0", -] - -[[package]] -name = "der" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" -dependencies = [ - "const-oid", - "pem-rfc7468", - "zeroize", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "const-oid", - "crypto-common 0.1.6", - "subtle", -] - -[[package]] -name = "digest" -version = "0.11.0-pre.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2e3d6615d99707295a9673e889bf363a04b2a466bd320c65a72536f7577379" -dependencies = [ - "block-buffer 0.11.0-rc.2", - "crypto-common 0.2.0-rc.1", -] - -[[package]] -name = "either" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" - -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "fastnbt" -version = "2.5.0" -source = "git+https://github.com/owengage/fastnbt.git#e2a5d8a7001d4f074ae99fd21bb485667934baeb" -dependencies = [ - "byteorder", - "cesu8", - "serde", - "serde_bytes", -] - -[[package]] -name = "fdeflate" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8090f921a24b04994d9929e204f50b498a33ea6ba559ffaa05e04f7ee7fb5ab" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "flate2" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-executor" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" -dependencies = [ - "cfg-if", - "libc", - "wasi", -] - -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" - -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" - -[[package]] -name = "hybrid-array" -version = "0.2.0-rc.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a41e5b0754cae5aaf7915f1df1147ba8d316fc6e019cfcc00fbaba96d5e030" -dependencies = [ - "typenum", -] - -[[package]] -name = "hyper" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" -dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", - "webpki-roots", -] - -[[package]] -name = "hyper-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] - -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "ipnet" -version = "2.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.159" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "lz4" -version = "1.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1febb2b4a79ddd1980eede06a8f7902197960aa0383ffcfdd62fe723036725" -dependencies = [ - "lz4-sys", -] - -[[package]] -name = "lz4-sys" -version = "1.11.1+lz4-1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest 0.10.7", -] - -[[package]] -name = "md5" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" - -[[package]] -name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", - "simd-adler32", -] - -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi", - "libc", - "log", - "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "nix" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "cfg_aliases", - "libc", -] - -[[package]] -name = "noise" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6da45c8333f2e152fc665d78a380be060eb84fad8ca4c9f7ac8ca29216cff0cc" -dependencies = [ - "num-traits", - "rand", - "rand_xorshift", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "num-integer" -version = "0.1.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "num_threads" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" -dependencies = [ - "libc", -] - -[[package]] -name = "object" -version = "0.36.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project-lite" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs1" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" -dependencies = [ - "der", - "pkcs8", - "spki", -] - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "png" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52f9d46a34a05a6a57566bc2bfae066ef07585a6e3fa30fbbdff5936380623f0" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "proc-macro2" -version = "1.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "pumpkin" -version = "0.1.0-dev" -dependencies = [ - "base64", - "bytes", - "crossbeam", - "ctrlc", - "digest 0.11.0-pre.9", - "hmac", - "itertools", - "log", - "mio", - "num-bigint", - "num-derive", - "num-traits", - "parking_lot", - "png", - "pumpkin-config", - "pumpkin-core", - "pumpkin-entity", - "pumpkin-inventory", - "pumpkin-protocol", - "pumpkin-registry", - "pumpkin-world", - "rand", - "rayon", - "reqwest", - "rsa", - "rsa-der", - "serde", - "serde_json", - "sha1", - "sha2", - "simple_logger", - "thiserror", - "tokio", - "uuid", -] - -[[package]] -name = "pumpkin-config" -version = "0.1.0" -dependencies = [ - "log", - "pumpkin-core", - "serde", - "serde-inline-default", - "toml", -] - -[[package]] -name = "pumpkin-core" -version = "0.1.0" -dependencies = [ - "colored", - "fastnbt", - "md5", - "num-derive", - "num-traits", - "serde", - "uuid", -] - -[[package]] -name = "pumpkin-entity" -version = "0.1.0" - -[[package]] -name = "pumpkin-inventory" -version = "0.1.0" -dependencies = [ - "crossbeam", - "itertools", - "num-derive", - "num-traits", - "parking_lot", - "pumpkin-world", - "thiserror", -] - -[[package]] -name = "pumpkin-macros" -version = "0.1.0" -dependencies = [ - "itertools", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn", -] - -[[package]] -name = "pumpkin-protocol" -version = "0.1.0" -dependencies = [ - "aes", - "bytes", - "cfb8", - "fastnbt", - "flate2", - "itertools", - "log", - "num-derive", - "num-traits", - "pumpkin-config", - "pumpkin-core", - "pumpkin-macros", - "pumpkin-world", - "serde", - "thiserror", - "uuid", -] - -[[package]] -name = "pumpkin-registry" -version = "0.1.0" -dependencies = [ - "fastnbt", - "pumpkin-core", - "pumpkin-protocol", - "serde", -] - -[[package]] -name = "pumpkin-world" -version = "0.1.0" -dependencies = [ - "derive_more", - "fastnbt", - "flate2", - "futures", - "itertools", - "log", - "lz4", - "noise", - "num-derive", - "num-traits", - "parking_lot", - "pumpkin-core", - "pumpkin-macros", - "rand", - "rayon", - "serde", - "serde_json", - "thiserror", - "tokio", -] - -[[package]] -name = "quinn" -version = "0.11.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" -dependencies = [ - "bytes", - "rand", - "ring", - "rustc-hash", - "rustls", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - -[[package]] -name = "quinn-udp" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" -dependencies = [ - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "reqwest" -version = "0.12.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" -dependencies = [ - "base64", - "bytes", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "once_cell", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-pemfile", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-rustls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots", - "windows-registry", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rsa" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" -dependencies = [ - "const-oid", - "digest 0.10.7", - "num-bigint-dig", - "num-integer", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "signature", - "spki", - "subtle", - "zeroize", -] - -[[package]] -name = "rsa-der" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19473b2de3164677ff38e4309c42448ba8d0fe5ad5fa722e7d278f991859aa6" -dependencies = [ - "simple_asn1", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "rustls" -version = "0.23.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" - -[[package]] -name = "rustls-webpki" -version = "0.102.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "serde" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-inline-default" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "484b43bb1114a28d1a574f5682d6079fa4c20e76faaff0cfd048216650e57101" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.210" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.128" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest 0.10.7", - "rand_core", -] - -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint", - "num-traits", - "thiserror", - "time", -] - -[[package]] -name = "simple_logger" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c5dfa5e08767553704aa0ffd9d9794d527103c736aba9854773851fd7497eb" -dependencies = [ - "colored", - "log", - "time", - "windows-sys 0.48.0", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "2.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -dependencies = [ - "futures-core", -] - -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.6.0", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "thiserror" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "pin-project-lite", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "toml" -version = "0.8.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.22.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - -[[package]] -name = "unicode-ident" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-normalization" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "uuid" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" -dependencies = [ - "getrandom", - "md-5", - "serde", -] - -[[package]] -name = "version_check" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" - -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" -dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" - -[[package]] -name = "web-sys" -version = "0.3.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.26.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "windows-registry" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" -dependencies = [ - "windows-result", - "windows-strings", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-result" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-strings" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" -dependencies = [ - "windows-result", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - -[[package]] -name = "windows-targets" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" -dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" - -[[package]] -name = "winnow" -version = "0.6.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" -dependencies = [ - "memchr", -] - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "byteorder", - "zerocopy-derive", -] - -[[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", -] - -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/pumpkin-world/src/world_gen/blender.rs b/pumpkin-world/src/world_gen/blender.rs new file mode 100644 index 000000000..5944201c7 --- /dev/null +++ b/pumpkin-world/src/world_gen/blender.rs @@ -0,0 +1 @@ +pub struct Blender {} diff --git a/pumpkin-world/src/world_gen/chunk.rs b/pumpkin-world/src/world_gen/chunk.rs new file mode 100644 index 000000000..eec758a19 --- /dev/null +++ b/pumpkin-world/src/world_gen/chunk.rs @@ -0,0 +1,59 @@ +use lazy_static::lazy_static; + +use crate::chunk::ChunkData; + +#[derive(Clone)] +pub enum GenerationState { + Empty, + StructureStart, + StructureRef, + Biome, + Noise, + Surface, + Carver, + Feature, + InitLight, + Light, + Spawn, + Full, +} + +pub struct Chunk { + data: ChunkData, + state: GenerationState, +} + +pub struct GenerationShapeConfig { + y_min: i32, + height: i32, + horizontal: i32, + vertical: i32, +} + +//Bits avaliable to encode y-pos +const SIZE_BITS_Y: i32 = 12; +const MAX_HEIGHT: i32 = (1 << SIZE_BITS_Y) - 32; +const MAX_COLUMN_HEIGHT: i32 = (MAX_HEIGHT >> 1) - 1; + +impl GenerationShapeConfig { + fn new(y_min: i32, height: i32, horizontal: i32, vertical: i32) -> Self { + if (y_min + height) > (MAX_COLUMN_HEIGHT + 1) { + panic!("Cannot be higher than max column height"); + } else if height % 16 != 0 { + panic!("Height must be a multiple of 16"); + } else if y_min % 16 != 0 { + panic!("Y min must be a multiple of 16"); + } + Self { + y_min, + height, + horizontal, + vertical, + } + } +} + +lazy_static! { + pub static ref surface_config: GenerationShapeConfig = + GenerationShapeConfig::new(-64, 384, 1, 2); +} diff --git a/pumpkin-world/src/world_gen/mod.rs b/pumpkin-world/src/world_gen/mod.rs index 4712a36f3..e3d37a590 100644 --- a/pumpkin-world/src/world_gen/mod.rs +++ b/pumpkin-world/src/world_gen/mod.rs @@ -1,3 +1,5 @@ +mod blender; +mod chunk; mod generator; mod generic_generator; mod implementation; diff --git a/pumpkin-world/src/world_gen/noise/density/mod.rs b/pumpkin-world/src/world_gen/noise/density/mod.rs new file mode 100644 index 000000000..1351d897c --- /dev/null +++ b/pumpkin-world/src/world_gen/noise/density/mod.rs @@ -0,0 +1,182 @@ +use std::rc::Rc; + +use noise::{InternalNoise, NoiseFunction, ShiftedNoiseFunction}; +use offset::{ShiftAFunction, ShiftBFunction}; +use unary::{ClampFunction, UnaryFunction, UnaryType}; + +use crate::world_gen::blender::Blender; + +mod noise; +mod offset; +mod unary; + +#[derive(Clone)] +pub enum DensityFunction<'a> { + Clamp(ClampFunction<'a>), + Unary(UnaryFunction<'a>), + Noise(NoiseFunction<'a>), + ShiftA(ShiftAFunction<'a>), + ShiftB(ShiftBFunction<'a>), + ShiftedNoise(ShiftedNoiseFunction<'a>), +} + +impl<'a> DensityFunction<'a> { + #[inline] + pub fn sample(&self, pos: &impl NoisePos) -> f64 { + match self { + Self::Clamp(func) => func.sample(pos), + Self::Unary(func) => func.sample(pos), + Self::Noise(func) => func.sample(pos), + Self::ShiftA(func) => func.sample(pos), + Self::ShiftB(func) => func.sample(pos), + Self::ShiftedNoise(func) => func.sample(pos), + } + } + + #[inline] + pub fn apply(&'a self, visitor: &'a impl Visitor) -> DensityFunction<'a> { + match self { + Self::Clamp(func) => func.apply(visitor), + Self::Unary(func) => func.apply(visitor), + Self::Noise(func) => func.apply(visitor), + Self::ShiftA(func) => func.apply(visitor), + Self::ShiftB(func) => func.apply(visitor), + Self::ShiftedNoise(func) => func.apply(visitor), + } + } + + #[inline] + pub fn fill(&self, densities: &[f64], applier: &impl Applier) -> Vec { + match self { + Self::Clamp(func) => func.fill(densities, applier), + Self::Unary(func) => func.fill(densities, applier), + Self::Noise(func) => func.fill(densities, applier), + Self::ShiftA(func) => func.fill(densities, applier), + Self::ShiftB(func) => func.fill(densities, applier), + Self::ShiftedNoise(func) => func.fill(densities, applier), + } + } + + #[inline] + pub fn max(&self) -> f64 { + match self { + Self::Clamp(func) => func.max(), + Self::Unary(func) => func.max(), + Self::Noise(func) => func.max(), + Self::ShiftA(func) => func.max(), + Self::ShiftB(func) => func.max(), + Self::ShiftedNoise(func) => func.max(), + } + } + + #[inline] + pub fn min(&self) -> f64 { + match self { + Self::Clamp(func) => func.min(), + Self::Unary(func) => func.min(), + Self::Noise(func) => func.min(), + Self::ShiftA(func) => func.min(), + Self::ShiftB(func) => func.min(), + Self::ShiftedNoise(func) => func.min(), + } + } + + pub fn clamp(&self, max: f64, min: f64) -> Self { + Self::Clamp(ClampFunction { + input: Rc::new(self.clone()), + min, + max, + }) + } + + pub fn abs(&self) -> Self { + Self::Unary(UnaryFunction::create(UnaryType::Abs, Rc::new(self.clone()))) + } + + pub fn square(&self) -> Self { + Self::Unary(UnaryFunction::create( + UnaryType::Square, + Rc::new(self.clone()), + )) + } + + pub fn cube(&self) -> Self { + Self::Unary(UnaryFunction::create( + UnaryType::Cube, + Rc::new(self.clone()), + )) + } + + pub fn half_negative(&self) -> Self { + Self::Unary(UnaryFunction::create( + UnaryType::HalfNeg, + Rc::new(self.clone()), + )) + } + + pub fn quarter_negative(&self) -> Self { + Self::Unary(UnaryFunction::create( + UnaryType::QuartNeg, + Rc::new(self.clone()), + )) + } + + pub fn squeeze(&self) -> Self { + Self::Unary(UnaryFunction::create( + UnaryType::Squeeze, + Rc::new(self.clone()), + )) + } +} + +pub trait NoisePos { + fn x(&self) -> i32; + fn y(&self) -> i32; + fn z(&self) -> i32; + + fn get_blender(&self) -> &Blender { + &Blender {} + } +} + +pub trait Applier { + fn at(&self, index: i32) -> impl NoisePos; + + fn fill<'a>(&self, densities: &[f64], function: &impl DensityFunctionImpl<'a>) -> Vec; +} + +pub trait Visitor { + fn apply(&self, function: &DensityFunction) -> DensityFunction; + + fn apply_internal_noise<'a>(&self, function: Rc>) -> Rc> { + function.clone() + } +} + +pub trait DensityFunctionImpl<'a> { + fn sample(&self, pos: &impl NoisePos) -> f64; + + fn fill(&self, densities: &[f64], applier: &impl Applier) -> Vec; + + fn apply(&'a self, visitor: &'a impl Visitor) -> DensityFunction<'a>; + + fn min(&self) -> f64; + + fn max(&self) -> f64; +} + +pub trait UnaryDensityFunction<'a>: DensityFunctionImpl<'a> { + fn input(&self) -> &DensityFunction; + + fn apply_density(&self, density: f64) -> f64; +} + +pub trait OffsetDensityFunction<'a>: DensityFunctionImpl<'a> { + fn offset_noise(&self) -> &InternalNoise<'a>; + + fn sample_3d(&self, x: f64, y: f64, z: f64) -> f64 { + self.offset_noise() + .sample(x * 0.25f64, y * 0.25f64, z * 0.25f64) + * 4f64 + } +} diff --git a/pumpkin-world/src/world_gen/noise/density/noise.rs b/pumpkin-world/src/world_gen/noise/density/noise.rs new file mode 100644 index 000000000..34131cf57 --- /dev/null +++ b/pumpkin-world/src/world_gen/noise/density/noise.rs @@ -0,0 +1,107 @@ +use std::rc::Rc; + +use crate::world_gen::noise::perlin::{DoublePerlinNoiseParameters, DoublePerlinNoiseSampler}; + +use super::{DensityFunction, DensityFunctionImpl}; + +pub(crate) struct InternalNoise<'a> { + data: DoublePerlinNoiseParameters<'a>, + sampler: Option, +} + +impl<'a> InternalNoise<'a> { + pub(crate) fn sample(&self, x: f64, y: f64, z: f64) -> f64 { + match &self.sampler { + Some(sampler) => sampler.sample(x, y, z), + None => 0f64, + } + } + + pub(crate) fn max_value(&self) -> f64 { + match &self.sampler { + Some(sampler) => sampler.max_value(), + None => 2f64, + } + } +} + +#[derive(Clone)] +pub struct NoiseFunction<'a> { + noise: Rc>, + xz_scale: f64, + y_scale: f64, +} + +impl<'a> DensityFunctionImpl<'a> for NoiseFunction<'a> { + fn sample(&self, pos: &impl super::NoisePos) -> f64 { + self.noise.sample( + pos.x() as f64 * self.xz_scale, + pos.y() as f64 * self.y_scale, + pos.z() as f64 * self.xz_scale, + ) + } + + fn fill(&self, densities: &[f64], applier: &impl super::Applier) -> Vec { + applier.fill(densities, self) + } + + fn apply(&self, visitor: &'a impl super::Visitor) -> super::DensityFunction<'a> { + visitor.apply(&super::DensityFunction::Noise(self.clone())) + } + + fn max(&self) -> f64 { + self.noise.max_value() + } + + fn min(&self) -> f64 { + -self.max() + } +} + +#[derive(Clone)] +pub struct ShiftedNoiseFunction<'a> { + shift_x: Rc>, + shift_y: Rc>, + shift_z: Rc>, + noise: Rc>, + xz_scale: f64, + y_scale: f64, +} + +impl<'a> DensityFunctionImpl<'a> for ShiftedNoiseFunction<'a> { + fn sample(&self, pos: &impl super::NoisePos) -> f64 { + let d = pos.x() as f64 * self.xz_scale + self.shift_x.sample(pos); + let e = pos.y() as f64 * self.y_scale + self.shift_y.sample(pos); + let f = pos.z() as f64 * self.xz_scale + self.shift_z.sample(pos); + + self.noise.sample(d, e, f) + } + + fn fill(&self, densities: &[f64], applier: &impl super::Applier) -> Vec { + applier.fill(densities, self) + } + + fn apply(&'a self, visitor: &'a impl super::Visitor) -> DensityFunction<'a> { + let new_x = self.shift_x.apply(visitor); + let new_y = self.shift_y.apply(visitor); + let new_z = self.shift_z.apply(visitor); + let new_noise = visitor.apply_internal_noise(self.noise.clone()); + + DensityFunction::ShiftedNoise(ShiftedNoiseFunction { + shift_x: Rc::new(new_x), + shift_y: Rc::new(new_y), + shift_z: Rc::new(new_z), + xz_scale: self.xz_scale, + y_scale: self.y_scale, + noise: new_noise, + }) + } + + fn max(&self) -> f64 { + self.noise.max_value() + } + + fn min(&self) -> f64 { + -self.max() + } +} diff --git a/pumpkin-world/src/world_gen/noise/density/offset.rs b/pumpkin-world/src/world_gen/noise/density/offset.rs new file mode 100644 index 000000000..26e16cd84 --- /dev/null +++ b/pumpkin-world/src/world_gen/noise/density/offset.rs @@ -0,0 +1,73 @@ +use std::rc::Rc; + +use super::{noise::InternalNoise, DensityFunction, DensityFunctionImpl, OffsetDensityFunction}; + +#[derive(Clone)] +pub struct ShiftAFunction<'a> { + offset: Rc>, +} + +impl<'a> OffsetDensityFunction<'a> for ShiftAFunction<'a> { + fn offset_noise(&self) -> &InternalNoise<'a> { + &self.offset + } +} + +impl<'a> DensityFunctionImpl<'a> for ShiftAFunction<'a> { + fn sample(&self, pos: &impl super::NoisePos) -> f64 { + self.sample_3d(pos.x() as f64, 0f64, pos.z() as f64) + } + + fn apply(&'a self, visitor: &'a impl super::Visitor) -> super::DensityFunction<'a> { + visitor.apply(&DensityFunction::ShiftA(ShiftAFunction { + offset: visitor.apply_internal_noise(self.offset.clone()), + })) + } + + fn fill(&self, densities: &[f64], applier: &impl super::Applier) -> Vec { + applier.fill(densities, self) + } + + fn max(&self) -> f64 { + self.offset_noise().max_value() * 4f64 + } + + fn min(&self) -> f64 { + -self.max() + } +} + +#[derive(Clone)] +pub struct ShiftBFunction<'a> { + offset: Rc>, +} + +impl<'a> OffsetDensityFunction<'a> for ShiftBFunction<'a> { + fn offset_noise(&self) -> &InternalNoise<'a> { + &self.offset + } +} + +impl<'a> DensityFunctionImpl<'a> for ShiftBFunction<'a> { + fn sample(&self, pos: &impl super::NoisePos) -> f64 { + self.sample_3d(pos.z() as f64, pos.x() as f64, 0f64) + } + + fn apply(&'a self, visitor: &'a impl super::Visitor) -> super::DensityFunction<'a> { + visitor.apply(&DensityFunction::ShiftB(ShiftBFunction { + offset: visitor.apply_internal_noise(self.offset.clone()), + })) + } + + fn fill(&self, densities: &[f64], applier: &impl super::Applier) -> Vec { + applier.fill(densities, self) + } + + fn max(&self) -> f64 { + self.offset_noise().max_value() * 4f64 + } + + fn min(&self) -> f64 { + -self.max() + } +} diff --git a/pumpkin-world/src/world_gen/noise/density/unary.rs b/pumpkin-world/src/world_gen/noise/density/unary.rs new file mode 100644 index 000000000..17fa123b9 --- /dev/null +++ b/pumpkin-world/src/world_gen/noise/density/unary.rs @@ -0,0 +1,147 @@ +use std::rc::Rc; + +use super::{DensityFunction, DensityFunctionImpl, UnaryDensityFunction}; + +#[derive(Clone)] +pub struct ClampFunction<'a> { + pub(crate) input: Rc>, + pub(crate) min: f64, + pub(crate) max: f64, +} + +impl<'a> UnaryDensityFunction<'a> for ClampFunction<'a> { + fn input(&self) -> &DensityFunction { + &self.input + } + + fn apply_density(&self, density: f64) -> f64 { + density.clamp(self.min, self.max) + } +} + +impl<'a> DensityFunctionImpl<'a> for ClampFunction<'a> { + fn apply(&'a self, visitor: &'a impl super::Visitor) -> DensityFunction<'a> { + DensityFunction::Clamp(ClampFunction { + input: Rc::new(self.input().apply(visitor)), + min: self.min, + max: self.max, + }) + } + + fn sample(&self, pos: &impl super::NoisePos) -> f64 { + self.apply_density(self.input().sample(pos)) + } + + fn fill(&self, densities: &[f64], applier: &impl super::Applier) -> Vec { + let densities = self.input().fill(densities, applier); + densities.iter().map(|x| self.apply_density(*x)).collect() + } + + fn min(&self) -> f64 { + self.min + } + + fn max(&self) -> f64 { + self.max + } +} + +#[derive(Clone)] +pub(crate) enum UnaryType { + Abs, + Square, + Cube, + HalfNeg, + QuartNeg, + Squeeze, +} + +#[derive(Clone)] +pub struct UnaryFunction<'a> { + action: UnaryType, + input: Rc>, + min: f64, + max: f64, +} + +impl<'a> UnaryFunction<'a> { + pub(crate) fn create(action: UnaryType, input: Rc>) -> UnaryFunction { + let base_min = input.min(); + let new_min = Self::internal_apply(&action, base_min); + let new_max = Self::internal_apply(&action, input.max()); + match action { + UnaryType::Abs | UnaryType::Square => Self { + action, + input, + min: f64::max(0f64, base_min), + max: f64::max(new_min, new_max), + }, + _ => Self { + action, + input, + min: new_min, + max: new_max, + }, + } + } + + fn internal_apply(action: &UnaryType, density: f64) -> f64 { + match action { + UnaryType::Abs => density.abs(), + UnaryType::Square => density * density, + UnaryType::Cube => density * density * density, + UnaryType::HalfNeg => { + if density > 0f64 { + density + } else { + density * 0.5f64 + } + } + UnaryType::QuartNeg => { + if density > 0f64 { + density + } else { + density * 0.25f64 + } + } + UnaryType::Squeeze => { + let d = density.clamp(-1f64, 1f64); + d / 2f64 - d * d * d / 24f64 + } + } + } +} + +impl<'a> UnaryDensityFunction<'a> for UnaryFunction<'a> { + fn apply_density(&self, density: f64) -> f64 { + Self::internal_apply(&self.action, density) + } + + fn input(&self) -> &DensityFunction { + &self.input + } +} + +impl<'a> DensityFunctionImpl<'a> for UnaryFunction<'a> { + fn sample(&self, pos: &impl super::NoisePos) -> f64 { + self.apply_density(self.input().sample(pos)) + } + + fn fill(&self, densities: &[f64], applier: &impl super::Applier) -> Vec { + let densities = self.input().fill(densities, applier); + densities.iter().map(|x| self.apply_density(*x)).collect() + } + + fn apply(&'a self, visitor: &'a impl super::Visitor) -> DensityFunction<'a> { + let raw = Self::create(self.action.clone(), Rc::new(self.input().apply(visitor))); + DensityFunction::Unary(raw) + } + + fn max(&self) -> f64 { + self.max + } + + fn min(&self) -> f64 { + self.min + } +} diff --git a/pumpkin-world/src/world_gen/noise/mod.rs b/pumpkin-world/src/world_gen/noise/mod.rs index ea5d51196..c5a8de241 100644 --- a/pumpkin-world/src/world_gen/noise/mod.rs +++ b/pumpkin-world/src/world_gen/noise/mod.rs @@ -1,7 +1,174 @@ #![allow(dead_code)] +mod density; mod perlin; mod simplex; +pub mod builtin_noise_params { + use lazy_static::lazy_static; + + use super::perlin::DoublePerlinNoiseParameters; + lazy_static! { + pub static ref temperature: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-10, &[1.5f64, 0f64, 1f64, 0f64, 0f64, 0f64,],); + pub static ref vegetation: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64, 1f64, 0f64, 0f64, 0f64, 0f64,],); + pub static ref continentalness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new( + -9, + &[1f64, 1f64, 2f64, 2f64, 2f64, 1f64, 1f64, 1f64, 1f64,], + ); + pub static ref erosion: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-9, &[1f64, 1f64, 0f64, 1f64, 1f64,],); + pub static ref temperature_large: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-12, &[1.5f64, 0f64, 1f64, 0f64, 0f64, 0f64,],); + pub static ref vegetation_large: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-10, &[1f64, 1f64, 0f64, 0f64, 0f64, 0f64,],); + pub static ref continentalness_large: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new( + -11, + &[1f64, 1f64, 2f64, 2f64, 2f64, 1f64, 1f64, 1f64, 1f64,], + ); + pub static ref erosion_large: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-11, &[1f64, 1f64, 0f64, 1f64, 1f64,],); + pub static ref ridge: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64, 2f64, 1f64, 0f64, 0f64, 0f64],); + pub static ref offset: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-3, &[1f64; 4],); + pub static ref aquifer_barrier: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-3, &[1f64,],); + pub static ref aquifer_barrier_floodedness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref aquifer_lava: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-1, &[1f64,],); + pub static ref aquifer_fluid_level_spread: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-5, &[1f64,],); + pub static ref pillar: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64; 2],); + pub static ref pillar_rareness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref pillar_thickness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref spaghetti_2d: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref spaghetti_2d_elevation: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref spaghetti_2d_modulator: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-11, &[1f64,],); + pub static ref spaghetti_2d_thickness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-11, &[1f64,],); + pub static ref spaghetti_3d_1: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref spaghetti_3d_2: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref spaghetti_3d_rarity: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-11, &[1f64,],); + pub static ref spaghetti_3d_thickness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref spaghetti_roughness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-5, &[1f64,],); + pub static ref spaghetti_roughness_modulator: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref cave_entrance: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[0.4f64, 0.5f64, 1f64],); + pub static ref cave_layer: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref cave_cheese: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new( + -8, + &[0.5f64, 1f64, 2f64, 1f64, 2f64, 1f64, 0f64, 2f64, 0f64,], + ); + pub static ref ore_veininess: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref ore_vein_a: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref ore_vein_b: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref ore_gap: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-5, &[1f64,],); + pub static ref noodle: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref noodle_thickness: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref noodle_ridge_a: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref noodle_ridge_b: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64,],); + pub static ref jagged: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-16, &[1f64; 16],); + pub static ref surface: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-6, &[1f64; 3],); + pub static ref surface_secondary: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-6, &[1f64, 1f64, 0f64, 1f64,],); + pub static ref clay_bands_offset: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref badlands_pillar: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-2, &[1f64; 4],); + pub static ref badlands_pillar_roof: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64,],); + pub static ref badlands_surface: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-6, &[1f64; 3],); + pub static ref iceberg_pillar: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-6, &[1f64; 4],); + pub static ref iceberg_pillar_roof: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-3, &[1f64,],); + pub static ref iceberg_surface: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-6, &[1f64; 3],); + pub static ref surface_swamp: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-2, &[1f64,],); + pub static ref calcite: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-9, &[1f64; 4],); + pub static ref gravel: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-8, &[1f64; 4],); + pub static ref powder_snow: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-6, &[1f64; 4],); + pub static ref packed_ice: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-7, &[1f64; 4],); + pub static ref ice: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-4, &[1f64; 4],); + pub static ref soul_sand_layer: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new( + -8, + &[ + 1f64, + 1f64, + 1f64, + 1f64, + 0f64, + 0f64, + 0f64, + 0f64, + 0.013333333333333334f64, + ], + ); + pub static ref gravel_layer: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new( + -8, + &[ + 1f64, + 1f64, + 1f64, + 1f64, + 0f64, + 0f64, + 0f64, + 0f64, + 0.013333333333333334f64, + ], + ); + pub static ref patch: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new( + -5, + &[1f64, 0f64, 0f64, 0f64, 0f64, 0.013333333333333334f64,], + ); + pub static ref netherrack: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-3, &[1f64, 0f64, 0f64, 0.35f64,],); + pub static ref nether_wart: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-3, &[1f64, 0f64, 0f64, 0.9f64,],); + pub static ref nether_state_selector: DoublePerlinNoiseParameters<'static> = + DoublePerlinNoiseParameters::new(-4, &[1f64,],); + } +} + pub fn lerp(delta: f64, start: f64, end: f64) -> f64 { start + delta * (end - start) } diff --git a/pumpkin-world/src/world_gen/noise/perlin.rs b/pumpkin-world/src/world_gen/noise/perlin.rs index a96b1fc6c..e30f6bf00 100644 --- a/pumpkin-world/src/world_gen/noise/perlin.rs +++ b/pumpkin-world/src/world_gen/noise/perlin.rs @@ -286,6 +286,20 @@ impl OctavePerlinNoiseSampler { } } +pub struct DoublePerlinNoiseParameters<'a> { + first_octave: i32, + amplitudes: &'a [f64], +} + +impl<'a> DoublePerlinNoiseParameters<'a> { + pub fn new(first_octave: i32, amplitudes: &'a [f64]) -> Self { + Self { + first_octave, + amplitudes, + } + } +} + pub struct DoublePerlinNoiseSampler { first_sampler: OctavePerlinNoiseSampler, second_sampler: OctavePerlinNoiseSampler, @@ -298,7 +312,14 @@ impl DoublePerlinNoiseSampler { 0.1f64 * (1f64 + 1f64 / (octaves + 1) as f64) } - pub fn new(rand: &mut RandomGenerator, first_octave: i32, amplitudes: &[f64]) -> Self { + pub fn max_value(&self) -> f64 { + self.max_value + } + + pub fn new(rand: &mut RandomGenerator, parameters: &DoublePerlinNoiseParameters) -> Self { + let first_octave = parameters.first_octave; + let amplitudes = parameters.amplitudes; + let first_sampler = OctavePerlinNoiseSampler::new(rand, first_octave, amplitudes); let second_sampler = OctavePerlinNoiseSampler::new(rand, first_octave, amplitudes); @@ -336,7 +357,9 @@ impl DoublePerlinNoiseSampler { mod double_perlin_noise_sampler_test { use pumpkin_core::random::{legacy_rand::LegacyRand, xoroshiro128::Xoroshiro, RandomImpl}; - use crate::world_gen::noise::perlin::{DoublePerlinNoiseSampler, RandomGenerator}; + use crate::world_gen::noise::perlin::{ + DoublePerlinNoiseParameters, DoublePerlinNoiseSampler, RandomGenerator, + }; #[test] fn sample_legacy() { @@ -344,7 +367,11 @@ mod double_perlin_noise_sampler_test { assert_eq!(rand.next_i32(), -1302745855); let mut rand_gen = RandomGenerator::Legacy(rand); - let sampler = DoublePerlinNoiseSampler::new(&mut rand_gen, 0, &[4f64]); + let params = DoublePerlinNoiseParameters { + first_octave: 0, + amplitudes: &[4f64], + }; + let sampler = DoublePerlinNoiseSampler::new(&mut rand_gen, ¶ms); let values = [ ( @@ -440,7 +467,13 @@ mod double_perlin_noise_sampler_test { assert_eq!(rand.next_i32(), -1678727252); let mut rand_gen = RandomGenerator::Xoroshiro(rand); - let sampler = DoublePerlinNoiseSampler::new(&mut rand_gen, 1, &[2f64, 4f64]); + + let params = DoublePerlinNoiseParameters { + first_octave: 1, + amplitudes: &[2f64, 4f64], + }; + + let sampler = DoublePerlinNoiseSampler::new(&mut rand_gen, ¶ms); let values = [ (