feat: more loot table work

This commit is contained in:
Alexander Medvedev 2026-05-22 22:23:47 +02:00
parent f926410e4b
commit bd544271e2
15 changed files with 1723 additions and 891 deletions

394
Cargo.lock generated
View File

@ -140,9 +140,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.5.0" version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53"
[[package]] [[package]]
name = "axum" name = "axum"
@ -243,9 +243,9 @@ dependencies = [
[[package]] [[package]]
name = "bumpalo" name = "bumpalo"
version = "3.20.2" version = "3.20.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649"
dependencies = [ dependencies = [
"allocator-api2", "allocator-api2",
] ]
@ -356,9 +356,9 @@ checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c"
[[package]] [[package]]
name = "cfb8" name = "cfb8"
version = "0.9.0" version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c22e6368a74b7dd7039e10da9f0300ab4520584f2960048a5a4a4e51f8e4e183" checksum = "7f2b823af3723db9d6326eed3102949445a3323378bab7d6ecb9107ff3cb9a08"
dependencies = [ dependencies = [
"cipher", "cipher",
] ]
@ -415,11 +415,11 @@ dependencies = [
[[package]] [[package]]
name = "cipher" name = "cipher"
version = "0.5.1" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e34d8227fe1ba289043aeb13792056ff80fd6de1a9f49137a5f499de8e8c78ea" checksum = "e8cf2a2c93cd704877c0858356ed03480ff301ee950b43f1cbe4573b088bfa6c"
dependencies = [ dependencies = [
"crypto-common 0.2.1", "crypto-common 0.2.2",
"inout", "inout",
] ]
@ -478,7 +478,7 @@ version = "3.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34"
dependencies = [ dependencies = [
"windows-sys 0.60.2", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -921,9 +921,9 @@ dependencies = [
[[package]] [[package]]
name = "crypto-common" name = "crypto-common"
version = "0.1.7" version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
dependencies = [ dependencies = [
"generic-array", "generic-array",
"typenum", "typenum",
@ -931,9 +931,9 @@ dependencies = [
[[package]] [[package]]
name = "crypto-common" name = "crypto-common"
version = "0.2.1" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77727bb15fa921304124b128af125e7e3b968275d1b108b379190264f4423710" checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453"
dependencies = [ dependencies = [
"hybrid-array", "hybrid-array",
] ]
@ -972,15 +972,6 @@ dependencies = [
"parking_lot_core", "parking_lot_core",
] ]
[[package]]
name = "debugid"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d"
dependencies = [
"uuid",
]
[[package]] [[package]]
name = "der" name = "der"
version = "0.7.10" version = "0.7.10"
@ -988,7 +979,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
dependencies = [ dependencies = [
"const-oid 0.9.6", "const-oid 0.9.6",
"pem-rfc7468 0.7.0",
"zeroize", "zeroize",
] ]
@ -999,7 +989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b"
dependencies = [ dependencies = [
"const-oid 0.10.2", "const-oid 0.10.2",
"pem-rfc7468 1.0.0", "pem-rfc7468",
"zeroize", "zeroize",
] ]
@ -1020,7 +1010,7 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
dependencies = [ dependencies = [
"block-buffer 0.10.4", "block-buffer 0.10.4",
"const-oid 0.9.6", "const-oid 0.9.6",
"crypto-common 0.1.7", "crypto-common 0.1.6",
"subtle", "subtle",
] ]
@ -1032,7 +1022,7 @@ checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
dependencies = [ dependencies = [
"block-buffer 0.12.0", "block-buffer 0.12.0",
"const-oid 0.10.2", "const-oid 0.10.2",
"crypto-common 0.2.1", "crypto-common 0.2.2",
"ctutils", "ctutils",
] ]
@ -1057,16 +1047,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "dispatch2"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e0e367e4e7da84520dedcac1901e4da967309406d1e51017ae1abfb97adbd38"
dependencies = [
"bitflags",
"objc2",
]
[[package]] [[package]]
name = "displaydoc" name = "displaydoc"
version = "0.2.5" version = "0.2.5"
@ -1119,8 +1099,6 @@ dependencies = [
"ff", "ff",
"generic-array", "generic-array",
"group", "group",
"hkdf",
"pem-rfc7468 0.7.0",
"pkcs8 0.10.2", "pkcs8 0.10.2",
"rand_core 0.6.4", "rand_core 0.6.4",
"sec1", "sec1",
@ -1130,9 +1108,9 @@ dependencies = [
[[package]] [[package]]
name = "embed-collections" name = "embed-collections"
version = "0.12.0" version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4240a95ffc1c77c1a4aa8cade21c017c8f044dffa6ec115c0107869d9cfd2422" checksum = "7443f27e9135fe3226421aaaae783096d74def1c626c15e0c4646a9a1782349a"
[[package]] [[package]]
name = "embedded-io" name = "embedded-io"
@ -1155,12 +1133,6 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "endian-type"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "869b0adbda23651a9c5c0c3d270aac9fcb52e8622a8f2b17e57802d7791962f2"
[[package]] [[package]]
name = "enum_dispatch" name = "enum_dispatch"
version = "0.3.13" version = "0.3.13"
@ -1186,7 +1158,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.60.2", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -1217,12 +1189,6 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
[[package]]
name = "fixedbitset"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
[[package]] [[package]]
name = "flate2" name = "flate2"
version = "1.1.9" version = "1.1.9"
@ -1368,25 +1334,11 @@ dependencies = [
"slab", "slab",
] ]
[[package]]
name = "fxprof-processed-profile"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25234f20a3ec0a962a61770cfe39ecf03cb529a6e474ad8cff025ed497eda557"
dependencies = [
"bitflags",
"debugid",
"rustc-hash",
"serde",
"serde_derive",
"serde_json",
]
[[package]] [[package]]
name = "generic-array" name = "generic-array"
version = "0.14.7" version = "0.14.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2"
dependencies = [ dependencies = [
"typenum", "typenum",
"version_check", "version_check",
@ -1557,15 +1509,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hkdf"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
dependencies = [
"hmac 0.12.1",
]
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.12.1" version = "0.12.1"
@ -1584,15 +1527,6 @@ dependencies = [
"digest 0.11.3", "digest 0.11.3",
] ]
[[package]]
name = "home"
version = "0.5.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d"
dependencies = [
"windows-sys 0.61.2",
]
[[package]] [[package]]
name = "http" name = "http"
version = "1.4.0" version = "1.4.0"
@ -1928,26 +1862,6 @@ version = "1.0.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
[[package]]
name = "ittapi"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1"
dependencies = [
"anyhow",
"ittapi-sys",
"log",
]
[[package]]
name = "ittapi-sys"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "jobserver" name = "jobserver"
version = "0.1.34" version = "0.1.34"
@ -1982,9 +1896,9 @@ dependencies = [
[[package]] [[package]]
name = "kqueue-sys" name = "kqueue-sys"
version = "1.1.0" version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7b65860415f949f23fa882e669f2dbd4a0f0eeb1acdd56790b30494afd7da2f" checksum = "07293a4e297ac234359b510362495713f75ea345d5307140414f20c69ffeb087"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"libc", "libc",
@ -2073,7 +1987,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed1c11dbd317fa5d0508cbb5ce47696bb27771e3c9604428e0e98c7c3d76d0d" checksum = "3ed1c11dbd317fa5d0508cbb5ce47696bb27771e3c9604428e0e98c7c3d76d0d"
dependencies = [ dependencies = [
"lz4_flex", "lz4_flex",
"twox-hash 1.6.3", "twox-hash",
] ]
[[package]] [[package]]
@ -2091,17 +2005,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "macro-string"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59a9dbbfc75d2688ed057456ce8a3ee3f48d12eec09229f560f3643b9f275653"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]] [[package]]
name = "matchers" name = "matchers"
version = "0.2.0" version = "0.2.0"
@ -2188,20 +2091,11 @@ dependencies = [
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
[[package]]
name = "nibble_vec"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43"
dependencies = [
"smallvec",
]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.31.2" version = "0.31.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d6d0705320c1e6ba1d912b5e37cf18071b6c2e9b7fa8215a1e8a7651966f5d3" checksum = "cf20d2fde8ff38632c426f1165ed7436270b44f199fc55284c38276f9db47c3d"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"cfg-if", "cfg-if",
@ -2255,15 +2149,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "nu-ansi-term"
version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"windows-sys 0.60.2",
]
[[package]] [[package]]
name = "num-bigint" name = "num-bigint"
version = "0.4.6" version = "0.4.6"
@ -2276,9 +2161,9 @@ dependencies = [
[[package]] [[package]]
name = "num-conv" name = "num-conv"
version = "0.2.1" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441"
[[package]] [[package]]
name = "num-derive" name = "num-derive"
@ -2318,15 +2203,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "objc2"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a12a8ed07aefc768292f076dc3ac8c48f3781c8f2d5851dd3d98950e8c5a89f"
dependencies = [
"objc2-encode",
]
[[package]] [[package]]
name = "objc2-core-foundation" name = "objc2-core-foundation"
version = "0.3.2" version = "0.3.2"
@ -2334,24 +2210,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536" checksum = "2a180dd8642fa45cdb7dd721cd4c11b1cadd4929ce112ebd8b9f5803cc79d536"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"dispatch2",
"objc2",
]
[[package]]
name = "objc2-encode"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ef25abbcd74fb2609453eb695bd2f860d389e457f67dc17cafc8b8cbc89d0c33"
[[package]]
name = "objc2-foundation"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e3e0adef53c21f888deb4fa59fc59f7eb17404926ee8a6f59f5df0fd7f9f3272"
dependencies = [
"bitflags",
"objc2",
] ]
[[package]] [[package]]
@ -2364,17 +2222,6 @@ dependencies = [
"objc2-core-foundation", "objc2-core-foundation",
] ]
[[package]]
name = "objc2-open-directory"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bb82bed227edf5201dfedf072bba4015a33d3d4a98519837295a90f0a23f676d"
dependencies = [
"objc2",
"objc2-core-foundation",
"objc2-foundation",
]
[[package]] [[package]]
name = "object" name = "object"
version = "0.39.1" version = "0.39.1"
@ -2453,15 +2300,6 @@ dependencies = [
"windows-link", "windows-link",
] ]
[[package]]
name = "pem-rfc7468"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
dependencies = [
"base64ct",
]
[[package]] [[package]]
name = "pem-rfc7468" name = "pem-rfc7468"
version = "1.0.0" version = "1.0.0"
@ -2520,16 +2358,6 @@ dependencies = [
"sha2 0.10.9", "sha2 0.10.9",
] ]
[[package]]
name = "petgraph"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
dependencies = [
"fixedbitset",
"indexmap",
]
[[package]] [[package]]
name = "phf" name = "phf"
version = "0.13.1" version = "0.13.1"
@ -2575,18 +2403,18 @@ dependencies = [
[[package]] [[package]]
name = "pin-project" name = "pin-project"
version = "1.1.12" version = "1.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbf0d9e68100b3a7989b4901972f265cd542e560a3a8a724e1e20322f4d06ce9" checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924"
dependencies = [ dependencies = [
"pin-project-internal", "pin-project-internal",
] ]
[[package]] [[package]]
name = "pin-project-internal" name = "pin-project-internal"
version = "1.1.12" version = "1.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a990e22f43e84855daf260dded30524ef4a9021cc7541c26540500a50b624389" checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@ -2644,28 +2472,6 @@ dependencies = [
"cobs", "cobs",
"embedded-io 0.4.0", "embedded-io 0.4.0",
"embedded-io 0.6.1", "embedded-io 0.6.1",
"heapless",
"serde",
]
[[package]]
name = "postcard-derive"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0232bd009a197ceec9cc881ba46f727fcd8060a2d8d6a9dde7a69030a6fe2bb"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "postcard-schema"
version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9475666d89f42231a0a57da32d5f6ca7f9b5cd4c335ea1fe8f3278215b7a21ff"
dependencies = [
"postcard-derive",
"serde", "serde",
] ]
@ -2722,7 +2528,6 @@ dependencies = [
"proc-macro-error-attr2", "proc-macro-error-attr2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn",
] ]
[[package]] [[package]]
@ -2751,7 +2556,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"itertools 0.13.0", "itertools 0.14.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn", "syn",
@ -3048,16 +2853,6 @@ version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
[[package]]
name = "radix_trie"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3b4431027dcd37fc2a73ef740b5f233aa805897935b8bce0195e41bbf9a3289a"
dependencies = [
"endian-type",
"nibble_vec",
]
[[package]] [[package]]
name = "rand" name = "rand"
version = "0.10.1" version = "0.10.1"
@ -3250,7 +3045,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys 0.60.2", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -3313,12 +3108,10 @@ dependencies = [
"bitflags", "bitflags",
"cfg-if", "cfg-if",
"clipboard-win", "clipboard-win",
"home",
"libc", "libc",
"log", "log",
"memchr", "memchr",
"nix", "nix",
"radix_trie",
"unicode-segmentation", "unicode-segmentation",
"unicode-width", "unicode-width",
"utf8parse", "utf8parse",
@ -3330,9 +3123,6 @@ name = "ruzstd"
version = "0.8.3" version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7c1c839d570d835527c9a5e4db7cb2198683a988cb9d7293fc8674e6bd58fc8" checksum = "a7c1c839d570d835527c9a5e4db7cb2198683a988cb9d7293fc8674e6bd58fc8"
dependencies = [
"twox-hash 2.1.2",
]
[[package]] [[package]]
name = "same-file" name = "same-file"
@ -3405,9 +3195,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.149" version = "1.0.150"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
dependencies = [ dependencies = [
"itoa", "itoa",
"memchr", "memchr",
@ -3578,7 +3368,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.60.2", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -3664,16 +3454,15 @@ dependencies = [
[[package]] [[package]]
name = "sysinfo" name = "sysinfo"
version = "0.39.0" version = "0.39.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd9f9fe3d2b7b75cf4f2805e5b9926e8ac47146667b16b86298c4a8bf08cc469" checksum = "14311e7e9a03114cd4b65eedd54e8fed2945e17f08586ae97ef53bc0669f9581"
dependencies = [ dependencies = [
"libc", "libc",
"memchr", "memchr",
"ntapi", "ntapi",
"objc2-core-foundation", "objc2-core-foundation",
"objc2-io-kit", "objc2-io-kit",
"objc2-open-directory",
"windows", "windows",
] ]
@ -3696,10 +3485,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd"
dependencies = [ dependencies = [
"fastrand", "fastrand",
"getrandom 0.4.2",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.60.2", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -3897,7 +3685,6 @@ version = "1.1.2+spec-1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee"
dependencies = [ dependencies = [
"indexmap",
"serde_core", "serde_core",
"serde_spanned", "serde_spanned",
"toml_datetime 1.1.1+spec-1.1.0", "toml_datetime 1.1.1+spec-1.1.0",
@ -4042,17 +3829,6 @@ dependencies = [
"valuable", "valuable",
] ]
[[package]]
name = "tracing-log"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3"
dependencies = [
"log",
"once_cell",
"tracing-core",
]
[[package]] [[package]]
name = "tracing-serde-structured" name = "tracing-serde-structured"
version = "0.4.0" version = "0.4.0"
@ -4061,7 +3837,6 @@ checksum = "0832510e9838a4ff7e45e278602ab0533686f9507bc6189e024e488602f29820"
dependencies = [ dependencies = [
"hash32", "hash32",
"heapless", "heapless",
"postcard-schema",
"serde", "serde",
"tracing-core", "tracing-core",
] ]
@ -4073,16 +3848,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319"
dependencies = [ dependencies = [
"matchers", "matchers",
"nu-ansi-term",
"once_cell", "once_cell",
"regex-automata", "regex-automata",
"sharded-slab", "sharded-slab",
"smallvec",
"thread_local", "thread_local",
"time", "time",
"tracing", "tracing",
"tracing-core", "tracing-core",
"tracing-log",
] ]
[[package]] [[package]]
@ -4101,12 +3873,6 @@ dependencies = [
"static_assertions", "static_assertions",
] ]
[[package]]
name = "twox-hash"
version = "2.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c"
[[package]] [[package]]
name = "typenum" name = "typenum"
version = "1.20.0" version = "1.20.0"
@ -4157,7 +3923,6 @@ checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"cookie_store", "cookie_store",
"flate2",
"log", "log",
"percent-encoding", "percent-encoding",
"rustls", "rustls",
@ -4324,23 +4089,6 @@ dependencies = [
"unicode-ident", "unicode-ident",
] ]
[[package]]
name = "wasm-compose"
version = "0.248.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96ba953e2b9b4b4b52a31cf4e3ee1c1374c872b6e012cf2138d1c37cba00bfd6"
dependencies = [
"anyhow",
"heck",
"indexmap",
"log",
"petgraph",
"smallvec",
"wasm-encoder 0.248.0",
"wasmparser 0.248.0",
"wat",
]
[[package]] [[package]]
name = "wasm-encoder" name = "wasm-encoder"
version = "0.244.0" version = "0.244.0"
@ -4371,16 +4119,6 @@ dependencies = [
"wasmparser 0.248.0", "wasmparser 0.248.0",
] ]
[[package]]
name = "wasm-encoder"
version = "0.249.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69830ccbbf41c55eb585991659fb70867ef628193af3a495f09a6956f7615e59"
dependencies = [
"leb128fmt",
"wasmparser 0.249.0",
]
[[package]] [[package]]
name = "wasm-metadata" name = "wasm-metadata"
version = "0.244.0" version = "0.244.0"
@ -4442,17 +4180,6 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "wasmparser"
version = "0.249.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30538cae9a794215f490b532df01c557e2e2bfac92569482554acd0992a102ea"
dependencies = [
"bitflags",
"indexmap",
"semver",
]
[[package]] [[package]]
name = "wasmprinter" name = "wasmprinter"
version = "0.248.0" version = "0.248.0"
@ -4477,10 +4204,6 @@ dependencies = [
"cc", "cc",
"cfg-if", "cfg-if",
"encoding_rs", "encoding_rs",
"futures",
"fxprof-processed-profile",
"gimli",
"ittapi",
"libc", "libc",
"log", "log",
"mach2", "mach2",
@ -4489,17 +4212,12 @@ dependencies = [
"once_cell", "once_cell",
"postcard", "postcard",
"pulley-interpreter", "pulley-interpreter",
"rayon",
"rustix", "rustix",
"semver", "semver",
"serde", "serde",
"serde_derive", "serde_derive",
"serde_json",
"smallvec", "smallvec",
"target-lexicon", "target-lexicon",
"tempfile",
"wasm-compose",
"wasm-encoder 0.248.0",
"wasmparser 0.248.0", "wasmparser 0.248.0",
"wasmtime-environ", "wasmtime-environ",
"wasmtime-internal-cache", "wasmtime-internal-cache",
@ -4513,7 +4231,6 @@ dependencies = [
"wasmtime-internal-unwinder", "wasmtime-internal-unwinder",
"wasmtime-internal-versioned-export-macros", "wasmtime-internal-versioned-export-macros",
"wasmtime-internal-winch", "wasmtime-internal-winch",
"wat",
"windows-sys 0.61.2", "windows-sys 0.61.2",
] ]
@ -4595,7 +4312,6 @@ version = "45.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bdae4b55b15a23d774b15f6e7cd90ae0d0aa17c47c12b4db098b3dd11ba9d58" checksum = "1bdae4b55b15a23d774b15f6e7cd90ae0d0aa17c47c12b4db098b3dd11ba9d58"
dependencies = [ dependencies = [
"anyhow",
"hashbrown 0.17.1", "hashbrown 0.17.1",
"libm", "libm",
"serde", "serde",
@ -4650,8 +4366,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b426a5d0ec9c11a1a4525ed4e973b7caf40223b6d392588bb9f6468e4ae9d29" checksum = "8b426a5d0ec9c11a1a4525ed4e973b7caf40223b6d392588bb9f6468e4ae9d29"
dependencies = [ dependencies = [
"cc", "cc",
"object",
"rustix",
"wasmtime-internal-versioned-export-macros", "wasmtime-internal-versioned-export-macros",
] ]
@ -4786,28 +4500,6 @@ dependencies = [
"wasmtime", "wasmtime",
] ]
[[package]]
name = "wast"
version = "249.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2474a321bf9ae2808e9fa23ac4ec2b27300e70985e30bcb5a38d43b76bfc901a"
dependencies = [
"bumpalo",
"leb128fmt",
"memchr",
"unicode-width",
"wasm-encoder 0.249.0",
]
[[package]]
name = "wat"
version = "1.249.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28af699d0a9c7e4e250b7b8e36167ae5215fbb4b7ae526bb4ce7b234ba0afc90"
dependencies = [
"wast",
]
[[package]] [[package]]
name = "webpki-roots" name = "webpki-roots"
version = "0.26.11" version = "0.26.11"
@ -4848,7 +4540,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [ dependencies = [
"windows-sys 0.60.2", "windows-sys 0.61.2",
] ]
[[package]] [[package]]
@ -5188,7 +4880,6 @@ version = "0.57.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
dependencies = [ dependencies = [
"bitflags",
"wit-bindgen-rust-macro 0.57.1", "wit-bindgen-rust-macro 0.57.1",
] ]
@ -5268,7 +4959,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "af9237d678e3513ad24e96fe98beacdc0db6405284ba2a2400418cf0d42caa89" checksum = "af9237d678e3513ad24e96fe98beacdc0db6405284ba2a2400418cf0d42caa89"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"macro-string",
"prettyplease", "prettyplease",
"proc-macro2", "proc-macro2",
"quote", "quote",

View File

@ -96,99 +96,105 @@ strip = false
[workspace.dependencies] [workspace.dependencies]
serde_json5 = "0.2.1"
tokio = { version = "1.52", default-features = false } tokio = { version = "1.52", default-features = false }
syn = { version = "2.0", default-features = false, features = ["printing"] } syn = { version = "2.0", default-features = false, features = ["printing"] }
thiserror = "2.0" thiserror = { version = "2.0", default-features = false }
bytes = "1.11" bytes = { version = "1.11", default-features = false, features = ["std"] }
# Concurrency/Parallelism and Synchronization # Concurrency/Parallelism and Synchronization
futures = { version = "0.3", default-features = false, features = ["executor"] } futures = { version = "0.3", default-features = false, features = ["executor"] }
rayon = "1.12" rayon = { version = "1.12", default-features = false }
crossbeam = "0.8" crossbeam = { version = "0.8", default-features = false, features = ["std"] }
uuid = { version = "1.23", features = ["serde", "v3", "v4"] } uuid = { version = "1.23", default-features = false, features = ["serde", "v3", "v4", "std"] }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", default-features = false, features = ["derive", "std"] }
serde_repr = { version = "0.1" } serde_repr = { version = "0.1", default-features = false }
serde_json = "1.0" serde_json = { version = "1.0", default-features = false, features = ["std"] }
tempfile = { version = "3.27.0", default-features = false } tempfile = { version = "3.27.0", default-features = false }
proc-macro-error2 = "2" proc-macro-error2 = { version = "2", default-features = false }
aes = "0.9" aes = { version = "0.9", default-features = false }
async-compression = "0.4.42" async-compression = { version = "0.4.42", default-features = false }
base64 = "0.22.1" base64 = { version = "0.22.1", default-features = false, features = ["std"] }
bitflags = "2.11.1" bitflags = { version = "2.11.1", default-features = false, features = ["std"] }
cesu8 = "1.1" cesu8 = { version = "1.1", default-features = false }
cfb8 = "0.9" cfb8 = { version = "0.9", default-features = false }
colored = "3.1" colored = { version = "3.1", default-features = false }
console-subscriber = { version = "0.5.0", default-features = false } console-subscriber = { version = "0.5.0", default-features = false }
crc-fast = "1.10.0" crc-fast = { version = "1.10.0", default-features = false, features = ["std"] }
criterion = { version = "0.8", default-features = false } criterion = { version = "0.8", default-features = false }
crossbeam-utils = "0.8.21" crossbeam-utils = { version = "0.8.21", default-features = false, features = ["std"] }
crossfire = { version = "3.1.15", features = ["compat"] } crossfire = { version = "3.1.15", default-features = false, features = ["compat"] }
crypto-bigint = "0.7.3" crypto-bigint = { version = "0.7.3", default-features = false }
dashmap = "6.2" dashmap = { version = "6.2", default-features = false }
ecdsa = "0.16.9" ecdsa = { version = "0.16.9", default-features = false, features = ["std"] }
either = "1.16.0" either = { version = "1.16.0", default-features = false }
enum_dispatch = "0.3.13" enum_dispatch = { version = "0.3.13", default-features = false }
flate2 = "1.1.9" flate2 = { version = "1.1.9", default-features = false, features = ["rust_backend"] }
heck = "0.5" heck = { version = "0.5", default-features = false }
hmac = "=0.13.0" hmac = { version = "=0.13.0", default-features = false }
indexmap = "2.14" indexmap = { version = "2.14", default-features = false, features = ["std"] }
itertools = "0.14.0" itertools = { version = "0.14.0", default-features = false, features = ["use_std"] }
libloading = "0.9" libloading = { version = "0.9", default-features = false, features = ["std"] }
lru = "0.18.0" lru = { version = "0.18.0", default-features = false }
lz4-java-wrc = "0.2.0" lz4-java-wrc = { version = "0.2.0", default-features = false, features = ["lz4_flex"] }
md5 = "0.8" md5 = { version = "0.8", default-features = false }
num-bigint = "0.4" num-bigint = { version = "0.4", default-features = false, features = ["std"] }
num-derive = "0.4" num-derive = { version = "0.4", default-features = false }
num-traits = "0.2" num-traits = { version = "0.2", default-features = false, features = ["std"] }
p384 = "0.13.1" p384 = { version = "0.13.1", default-features = false, features = ["std", "arithmetic", "pkcs8"] }
phf = "0.13.1" phf = { version = "0.13.1", default-features = false, features = ["std"] }
proc-macro2 = "1.0" proc-macro2 = { version = "1.0", default-features = false, features = ["proc-macro"] }
pumpkin-codecs = { path = "pumpkin-codecs" } pumpkin-codecs = { path = "pumpkin-codecs", default-features = false }
pumpkin-config = { path = "pumpkin-config" } pumpkin-config = { path = "pumpkin-config", default-features = false }
pumpkin-data = { path = "pumpkin-data" } pumpkin-data = { path = "pumpkin-data", default-features = false }
pumpkin-inventory = { path = "pumpkin-inventory" } pumpkin-inventory = { path = "pumpkin-inventory", default-features = false }
pumpkin-macros = { path = "pumpkin-macros" } pumpkin-macros = { path = "pumpkin-macros", default-features = false }
pumpkin-nbt = { path = "pumpkin-nbt" } pumpkin-nbt = { path = "pumpkin-nbt", default-features = false }
pumpkin-protocol = { path = "pumpkin-protocol" } pumpkin-protocol = { path = "pumpkin-protocol", default-features = false }
pumpkin-util = { path = "pumpkin-util" } pumpkin-util = { path = "pumpkin-util", default-features = false }
pumpkin-world = { path = "pumpkin-world" } pumpkin-world = { path = "pumpkin-world", default-features = false }
quote = "1.0" quote = { version = "1.0", default-features = false, features = ["proc-macro"] }
rand = "0.10.1" rand = { version = "0.10.1", default-features = false, features = ["std", "std_rng", "thread_rng"] }
rsa = "=0.10.0-rc.18" rsa = { version = "=0.10.0-rc.18", default-features = false, features = ["std", "encoding"] }
cipher = "0.5.2" cipher = { version = "0.5.2", default-features = false }
rustc-hash = "2.1.2" rustc-hash = { version = "2.1.2", default-features = false, features = ["std"] }
rustyline = "18.0.0" rustyline = { version = "18.0.0", default-features = false, features = ["with-file-history"] }
ruzstd = "0.8.3" ruzstd = { version = "0.8.3", default-features = false, features = ["std"] }
serde_json5 = "0.2.1" sha1 = { version = "=0.11.0", default-features = false, features = ["oid"] }
sha1 = "=0.11.0" sha2 = { version = "=0.11.0", default-features = false, features = ["oid"] }
sha2 = "=0.11.0" signature = { version = "3.0.0", default-features = false, features = ["std"] }
signature = "3.0.0" tracing = { version = "0.1.44", default-features = false, features = ["std", "attributes"] }
tracing = "0.1.44" tracing-subscriber = { version = "0.3.23", default-features = false, features = [
tracing-subscriber = { version = "0.3.23", features = [
"env-filter", "env-filter",
"fmt", "fmt",
"time", "time",
"std",
] } ] }
slotmap = "1.1" slotmap = { version = "1.1", default-features = false, features = ["std"] }
temp-dir = "0.2.0" temp-dir = { version = "0.2.0", default-features = false }
thread_local = "1.1.9" thread_local = { version = "1.1.9", default-features = false }
time = "0.3" time = { version = "0.3", default-features = false, features = ["std"] }
arc-swap = "1.9" arc-swap = { version = "1.9", default-features = false }
tokio-util = "0.7.18" tokio-util = { version = "0.7.18", default-features = false }
toml = "1.1" toml = { version = "1.1", default-features = false, features = ["parse", "display", "serde"] }
ureq = "3.3.0" ureq = { version = "3.3.0", default-features = false, features = ["rustls"] }
notify = "8.2.0" notify = { version = "8.2.0", default-features = false, features = ["macos_fsevent"] }
wasmtime = "45.0" sysinfo = { version = "0.39", default-features = false, features = ["system"] }
rustc_version_runtime = { version = "0.3", default-features = false }
ordered-float = { version = "5.3", default-features = false, features = ["std"] }
xxhash-rust = { version = "0.8", default-features = false, features = ["xxh64"] }
wasmtime = { version = "45.0", default-features = false, features = ["runtime", "component-model", "async", "cache", "cranelift", "gc", "threads", "std"] }
wasmtime-wasi = { version = "45.0", default-features = false, features = ["p2"] } wasmtime-wasi = { version = "45.0", default-features = false, features = ["p2"] }
wasmtime-wasi-http = "45.0" wasmtime-wasi-http = { version = "45.0", default-features = false, features = ["p2", "default-send-request"] }
# needed for interacting with wasmtime-wasi-http - keep in sync # needed for interacting with wasmtime-wasi-http - keep in sync
hyper = { version = "^1.9", features = ["full"] } hyper = { version = "^1.9", default-features = false }
wit-bindgen = "0.57" wit-bindgen = { version = "0.57", default-features = false, features = ["macros"] }
postcard = { version = "1.1", features = ["alloc"] } postcard = { version = "1.1", default-features = false, features = ["alloc"] }
tracing-serde-structured = "0.4" tracing-serde-structured = { version = "0.4", default-features = false }

File diff suppressed because one or more lines are too long

View File

@ -259,7 +259,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb"
dependencies = [ dependencies = [
"const-oid 0.9.6", "const-oid 0.9.6",
"pem-rfc7468 0.7.0",
"zeroize", "zeroize",
] ]
@ -270,7 +269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b" checksum = "71fd89660b2dc699704064e59e9dba0147b903e85319429e131620d022be411b"
dependencies = [ dependencies = [
"const-oid 0.10.2", "const-oid 0.10.2",
"pem-rfc7468 1.0.0", "pem-rfc7468",
"zeroize", "zeroize",
] ]
@ -335,8 +334,6 @@ dependencies = [
"ff", "ff",
"generic-array", "generic-array",
"group", "group",
"hkdf",
"pem-rfc7468 0.7.0",
"pkcs8 0.10.2", "pkcs8 0.10.2",
"rand_core 0.6.4", "rand_core 0.6.4",
"sec1", "sec1",
@ -461,15 +458,6 @@ version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hkdf"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
dependencies = [
"hmac",
]
[[package]] [[package]]
name = "hmac" name = "hmac"
version = "0.12.1" version = "0.12.1"
@ -632,15 +620,6 @@ dependencies = [
"sha2 0.10.9", "sha2 0.10.9",
] ]
[[package]]
name = "pem-rfc7468"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412"
dependencies = [
"base64ct",
]
[[package]] [[package]]
name = "pem-rfc7468" name = "pem-rfc7468"
version = "1.0.0" version = "1.0.0"
@ -1254,7 +1233,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0"
dependencies = [ dependencies = [
"base64", "base64",
"flate2",
"log", "log",
"percent-encoding", "percent-encoding",
"rustls", "rustls",

View File

@ -112,6 +112,25 @@ impl ToTokens for ItemEntryStruct {
} }
} }
/// Deserialized loot table reference entry holding the target loot table key.
#[derive(Deserialize, Clone, Debug)]
pub struct LootTableEntryStruct {
/// Namespaced loot table key.
value: String,
}
impl ToTokens for LootTableEntryStruct {
fn to_tokens(&self, tokens: &mut TokenStream) {
let value = LitStr::new(&self.value, Span::call_site());
tokens.extend(quote! {
LootTableEntry {
value: #value,
}
});
}
}
/// Deserialized alternatives loot entry that tries each child in order until one succeeds. /// Deserialized alternatives loot entry that tries each child in order until one succeeds.
#[derive(Deserialize, Clone, Debug)] #[derive(Deserialize, Clone, Debug)]
pub struct AlternativeEntryStruct { pub struct AlternativeEntryStruct {
@ -228,7 +247,7 @@ pub enum LootPoolEntryTypesStruct {
Item(ItemEntryStruct), Item(ItemEntryStruct),
/// References another loot table by namespaced key. /// References another loot table by namespaced key.
#[serde(rename = "minecraft:loot_table")] #[serde(rename = "minecraft:loot_table")]
LootTable, LootTable(LootTableEntryStruct),
/// Yields dynamically determined drops (e.g., shulker box contents). /// Yields dynamically determined drops (e.g., shulker box contents).
#[serde(rename = "minecraft:dynamic")] #[serde(rename = "minecraft:dynamic")]
Dynamic(DynamicEntryStruct), Dynamic(DynamicEntryStruct),
@ -255,8 +274,8 @@ impl ToTokens for LootPoolEntryTypesStruct {
Self::Item(item) => { Self::Item(item) => {
tokens.extend(quote! { LootPoolEntryTypes::Item(#item) }); tokens.extend(quote! { LootPoolEntryTypes::Item(#item) });
} }
Self::LootTable => { Self::LootTable(entry) => {
tokens.extend(quote! { LootPoolEntryTypes::LootTable }); tokens.extend(quote! { LootPoolEntryTypes::LootTable(#entry) });
} }
Self::Dynamic(_entry) => { Self::Dynamic(_entry) => {
// TODO // TODO
@ -278,34 +297,91 @@ impl ToTokens for LootPoolEntryTypesStruct {
} }
} }
#[derive(Deserialize, Clone, Debug)]
#[serde(untagged)]
pub enum StringOrVec {
String(String),
Vec(Vec<String>),
}
#[derive(Deserialize, Clone, Debug)]
pub struct ItemPredicateStruct {
pub items: Option<StringOrVec>,
}
#[derive(Deserialize, Clone, Debug)]
pub struct EntityPredicateStruct {
#[serde(rename = "type")]
pub entity_type: Option<StringOrVec>,
}
impl ToTokens for EntityPredicateStruct {
fn to_tokens(&self, tokens: &mut TokenStream) {
tokens.extend(quote! { () });
}
}
#[derive(Deserialize, Clone, Debug)]
pub struct DamageSourcePredicateStruct {
pub source_entity: Option<EntityPredicateStruct>,
pub direct_entity: Option<EntityPredicateStruct>,
}
impl ToTokens for DamageSourcePredicateStruct {
fn to_tokens(&self, tokens: &mut TokenStream) {
tokens.extend(quote! { () });
}
}
#[derive(Deserialize, Clone, Debug)]
pub struct LocationPredicateStruct {
pub biome: Option<StringOrVec>,
pub dimension: Option<StringOrVec>,
}
impl ToTokens for LocationPredicateStruct {
fn to_tokens(&self, tokens: &mut TokenStream) {
tokens.extend(quote! { () });
}
}
/// Deserialized loot condition, tagged by the `"condition"` field. /// Deserialized loot condition, tagged by the `"condition"` field.
#[derive(Deserialize, Clone, Debug)] #[derive(Deserialize, Clone, Debug)]
#[serde(tag = "condition")] #[serde(tag = "condition")]
pub enum LootConditionStruct { pub enum LootConditionStruct {
/// Passes if the wrapped condition fails. /// Passes if the wrapped condition fails.
#[serde(rename = "minecraft:inverted")] #[serde(rename = "minecraft:inverted")]
Inverted, Inverted { term: Box<LootConditionStruct> },
/// Passes if any of the child conditions pass. /// Passes if any of the child conditions pass.
#[serde(rename = "minecraft:any_of")] #[serde(rename = "minecraft:any_of")]
AnyOf, AnyOf { terms: Vec<LootConditionStruct> },
/// Passes if all child conditions pass. /// Passes if all child conditions pass.
#[serde(rename = "minecraft:all_of")] #[serde(rename = "minecraft:all_of")]
AllOf, AllOf { terms: Vec<LootConditionStruct> },
/// Passes with the given probability. /// Passes with the given probability.
#[serde(rename = "minecraft:random_chance")] #[serde(rename = "minecraft:random_chance")]
RandomChance { chance: f32 }, RandomChance { chance: f32 },
/// Passes with probability scaled by an enchantment level. /// Passes with probability scaled by an enchantment level.
#[serde(rename = "minecraft:random_chance_with_enchanted_bonus")] #[serde(rename = "minecraft:random_chance_with_enchanted_bonus")]
RandomChanceWithEnchantedBonus, RandomChanceWithEnchantedBonus {
enchantment: String,
chances: Option<Vec<f32>>,
},
/// Passes based on entity NBT predicates. /// Passes based on entity NBT predicates.
#[serde(rename = "minecraft:entity_properties")] #[serde(rename = "minecraft:entity_properties")]
EntityProperties, EntityProperties {
entity: Option<String>,
predicate: Option<EntityPredicateStruct>,
},
/// Passes if the block was killed by a player. /// Passes if the block was killed by a player.
#[serde(rename = "minecraft:killed_by_player")] #[serde(rename = "minecraft:killed_by_player")]
KilledByPlayer, KilledByPlayer,
/// Passes based on entity scoreboard values. /// Passes based on entity scoreboard values.
#[serde(rename = "minecraft:entity_scores")] #[serde(rename = "minecraft:entity_scores")]
EntityScores, EntityScores {
entity: Option<String>,
scores: Option<BTreeMap<String, StringOrVec>>,
},
/// Passes if the source block has the specified block-state properties. /// Passes if the source block has the specified block-state properties.
#[serde(rename = "minecraft:block_state_property")] #[serde(rename = "minecraft:block_state_property")]
BlockStateProperty { BlockStateProperty {
@ -316,52 +392,103 @@ pub enum LootConditionStruct {
}, },
/// Passes if the tool matches an item predicate. /// Passes if the tool matches an item predicate.
#[serde(rename = "minecraft:match_tool")] #[serde(rename = "minecraft:match_tool")]
MatchTool, MatchTool {
predicate: Option<ItemPredicateStruct>,
},
/// Passes with probability based on an enchantment's level. /// Passes with probability based on an enchantment's level.
#[serde(rename = "minecraft:table_bonus")] #[serde(rename = "minecraft:table_bonus")]
TableBonus, TableBonus {
enchantment: String,
chances: Vec<f32>,
},
/// Passes if the item survives an explosion. /// Passes if the item survives an explosion.
#[serde(rename = "minecraft:survives_explosion")] #[serde(rename = "minecraft:survives_explosion")]
SurvivesExplosion, SurvivesExplosion,
/// Passes based on the damage source's properties. /// Passes based on the damage source's properties.
#[serde(rename = "minecraft:damage_source_properties")] #[serde(rename = "minecraft:damage_source_properties")]
DamageSourceProperties, DamageSourceProperties {
predicate: Option<DamageSourcePredicateStruct>,
},
/// Passes based on the block's location. /// Passes based on the block's location.
#[serde(rename = "minecraft:location_check")] #[serde(rename = "minecraft:location_check")]
LocationCheck, LocationCheck {
predicate: Option<LocationPredicateStruct>,
#[serde(rename = "offsetX")]
offset_x: Option<i32>,
#[serde(rename = "offsetY")]
offset_y: Option<i32>,
#[serde(rename = "offsetZ")]
offset_z: Option<i32>,
},
/// Passes based on current weather conditions. /// Passes based on current weather conditions.
#[serde(rename = "minecraft:weather_check")] #[serde(rename = "minecraft:weather_check")]
WeatherCheck, WeatherCheck {
raining: Option<bool>,
thundering: Option<bool>,
},
/// References an external predicate by ID. /// References an external predicate by ID.
#[serde(rename = "minecraft:reference")] #[serde(rename = "minecraft:reference")]
Reference, Reference {
name: String,
},
/// Passes based on the current in-game time. /// Passes based on the current in-game time.
#[serde(rename = "minecraft:time_check")] #[serde(rename = "minecraft:time_check")]
TimeCheck, TimeCheck {
#[serde(rename = "value")]
range: LootFunctionLimitCountStruct,
period: Option<u64>,
},
/// Passes based on a numeric value range check. /// Passes based on a numeric value range check.
#[serde(rename = "minecraft:value_check")] #[serde(rename = "minecraft:value_check")]
ValueCheck, ValueCheck {
value: LootFunctionNumberProviderStruct,
range: LootFunctionLimitCountStruct,
},
/// Passes if an enchantment is currently active. /// Passes if an enchantment is currently active.
#[serde(rename = "minecraft:enchantment_active_check")] #[serde(rename = "minecraft:enchantment_active_check")]
EnchantmentActiveCheck, EnchantmentActiveCheck {
active: bool,
},
} }
impl ToTokens for LootConditionStruct { impl ToTokens for LootConditionStruct {
/// Emits the matching `LootCondition::*` token stream for code generation. /// Emits the matching `LootCondition::*` token stream for code generation.
fn to_tokens(&self, tokens: &mut TokenStream) { fn to_tokens(&self, tokens: &mut TokenStream) {
let name = match self { let name = match self {
Self::Inverted => quote! { LootCondition::Inverted }, Self::Inverted { term } => quote! { LootCondition::Inverted(&#term) },
Self::AnyOf => quote! { LootCondition::AnyOf }, Self::AnyOf { terms } => quote! { LootCondition::AnyOf(&[#(#terms),*]) },
Self::AllOf => quote! { LootCondition::AllOf }, Self::AllOf { terms } => quote! { LootCondition::AllOf(&[#(#terms),*]) },
Self::RandomChance { chance } => { Self::RandomChance { chance } => {
quote! { LootCondition::RandomChance { chance: #chance } } quote! { LootCondition::RandomChance { chance: #chance } }
} }
Self::RandomChanceWithEnchantedBonus => { Self::RandomChanceWithEnchantedBonus { enchantment, chances } => {
quote! { LootCondition::RandomChanceWithEnchantedBonus } let e = LitStr::new(enchantment, Span::call_site());
if let Some(chances) = chances {
quote! { LootCondition::RandomChanceWithEnchantedBonus { enchantment: #e, chances: Some(&[#(#chances),*]) } }
} else {
quote! { LootCondition::RandomChanceWithEnchantedBonus { enchantment: #e, chances: None } }
}
}
Self::EntityProperties { entity, predicate } => {
let entity = entity.as_deref().unwrap_or("this");
let e = LitStr::new(entity, Span::call_site());
let expected_type = predicate.as_ref().and_then(|p| p.entity_type.as_ref()).map(|t| {
match t {
StringOrVec::String(s) => quote! { Some(#s) },
StringOrVec::Vec(v) => {
let s = &v[0];
quote! { Some(#s) }
}
}
}).unwrap_or(quote! { None });
quote! { LootCondition::EntityProperties { entity: #e, expected_type: #expected_type } }
} }
Self::EntityProperties => quote! { LootCondition::EntityProperties },
Self::KilledByPlayer => quote! { LootCondition::KilledByPlayer }, Self::KilledByPlayer => quote! { LootCondition::KilledByPlayer },
Self::EntityScores => quote! { LootCondition::EntityScores }, Self::EntityScores { entity, scores: _ } => {
let entity = entity.as_deref().unwrap_or("this");
let e = LitStr::new(entity, Span::call_site());
quote! { LootCondition::EntityScores { entity: #e } }
}
Self::BlockStateProperty { block, properties } => { Self::BlockStateProperty { block, properties } => {
let properties: Vec<_> = properties let properties: Vec<_> = properties
.iter() .iter()
@ -369,19 +496,101 @@ impl ToTokens for LootConditionStruct {
.collect(); .collect();
quote! { LootCondition::BlockStateProperty { block: #block, properties: &[#(#properties),*] } } quote! { LootCondition::BlockStateProperty { block: #block, properties: &[#(#properties),*] } }
} }
Self::MatchTool => quote! { LootCondition::MatchTool }, Self::MatchTool { predicate } => {
Self::TableBonus => quote! { LootCondition::TableBonus }, if let Some(pred) = predicate {
Self::SurvivesExplosion => quote! { LootCondition::SurvivesExplosion }, if let Some(items) = &pred.items {
Self::DamageSourceProperties => { match items {
quote! { LootCondition::DamageSourceProperties } StringOrVec::String(s) => {
let s = LitStr::new(s, Span::call_site());
quote! { LootCondition::MatchTool { items: Some(&[#s]) } }
} }
Self::LocationCheck => quote! { LootCondition::LocationCheck }, StringOrVec::Vec(v) => {
Self::WeatherCheck => quote! { LootCondition::WeatherCheck }, let v = v.iter().map(|s| LitStr::new(s, Span::call_site()));
Self::Reference => quote! { LootCondition::Reference }, quote! { LootCondition::MatchTool { items: Some(&[#(#v),*]) } }
Self::TimeCheck => quote! { LootCondition::TimeCheck }, }
Self::ValueCheck => quote! { LootCondition::ValueCheck }, }
Self::EnchantmentActiveCheck => { } else {
quote! { LootCondition::EnchantmentActiveCheck } quote! { LootCondition::MatchTool { items: None } }
}
} else {
quote! { LootCondition::MatchTool { items: None } }
}
}
Self::TableBonus { enchantment, chances } => {
let e = LitStr::new(enchantment, Span::call_site());
quote! { LootCondition::TableBonus { enchantment: #e, chances: &[#(#chances),*] } }
}
Self::SurvivesExplosion => quote! { LootCondition::SurvivesExplosion },
Self::DamageSourceProperties { predicate } => {
let expected_source_type = predicate
.as_ref()
.and_then(|p| p.source_entity.as_ref())
.and_then(|e| e.entity_type.as_ref())
.map(|t| match t {
StringOrVec::String(s) => quote! { Some(#s) },
StringOrVec::Vec(v) => {
let s = &v[0];
quote! { Some(#s) }
}
})
.unwrap_or(quote! { None });
let expected_direct_type = predicate
.as_ref()
.and_then(|p| p.direct_entity.as_ref())
.and_then(|e| e.entity_type.as_ref())
.map(|t| match t {
StringOrVec::String(s) => quote! { Some(#s) },
StringOrVec::Vec(v) => {
let s = &v[0];
quote! { Some(#s) }
}
})
.unwrap_or(quote! { None });
quote! { LootCondition::DamageSourceProperties { expected_source_type: #expected_source_type, expected_direct_type: #expected_direct_type } }
}
Self::LocationCheck {
predicate,
offset_x,
offset_y,
offset_z,
} => {
let ox = offset_x.unwrap_or(0);
let oy = offset_y.unwrap_or(0);
let oz = offset_z.unwrap_or(0);
let expected_biome = predicate.as_ref().and_then(|p| p.biome.as_ref()).map(|b| {
match b {
StringOrVec::String(s) => quote! { Some(#s) },
StringOrVec::Vec(v) => {
let s = &v[0];
quote! { Some(#s) }
}
}
}).unwrap_or(quote! { None });
quote! { LootCondition::LocationCheck { offset_x: #ox, offset_y: #oy, offset_z: #oz, expected_biome: #expected_biome } }
}
Self::WeatherCheck { raining, thundering } => {
let r = raining.map(|b| quote! { Some(#b) }).unwrap_or(quote! { None });
let t = thundering.map(|b| quote! { Some(#b) }).unwrap_or(quote! { None });
quote! { LootCondition::WeatherCheck { raining: #r, thundering: #t } }
}
Self::Reference { name } => {
let n = LitStr::new(name, Span::call_site());
quote! { LootCondition::Reference { name: #n } }
}
Self::TimeCheck { range, period } => {
let r = range.to_token_stream();
let p = period.map(|val| quote! { Some(#val) }).unwrap_or(quote! { None });
quote! { LootCondition::TimeCheck { range: #r, period: #p } }
}
Self::ValueCheck { value, range } => {
let v = value.to_token_stream();
let r = range.to_token_stream();
quote! { LootCondition::ValueCheck { value: #v, range: #r } }
}
Self::EnchantmentActiveCheck { active } => {
quote! { LootCondition::EnchantmentActiveCheck { active: #active } }
} }
}; };
@ -613,6 +822,14 @@ pub struct LootFunctionLimitCountStruct {
max: Option<f32>, max: Option<f32>,
} }
impl ToTokens for LootFunctionLimitCountStruct {
fn to_tokens(&self, tokens: &mut TokenStream) {
let min = self.min.map(|val| quote! { Some(#val) }).unwrap_or(quote! { None });
let max = self.max.map(|val| quote! { Some(#val) }).unwrap_or(quote! { None });
tokens.extend(quote! { (#min, #max) });
}
}
/// Deserialized bonus parameters for the `ApplyBonus` loot function. /// Deserialized bonus parameters for the `ApplyBonus` loot function.
#[derive(Deserialize, Clone, Debug)] #[derive(Deserialize, Clone, Debug)]
#[serde(untagged)] #[serde(untagged)]

File diff suppressed because it is too large Load Diff

View File

@ -1433,7 +1433,16 @@ impl EntityType {
functions: Some(&[ functions: Some(&[
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::EnchantedCountIncrease, content: LootFunctionTypes::EnchantedCountIncrease,
@ -1506,7 +1515,16 @@ impl EntityType {
conditions: None, conditions: None,
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}]), }]),
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
@ -1731,7 +1749,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::EnchantedCountIncrease, content: LootFunctionTypes::EnchantedCountIncrease,
@ -1888,7 +1915,10 @@ impl EntityType {
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "attacker",
expected_type: Some("#minecraft:skeletons"),
}]),
functions: None, functions: None,
}, },
]), ]),
@ -2010,7 +2040,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
]), ]),
}], }],
@ -2215,7 +2254,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -2338,7 +2380,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
]), ]),
}, },
@ -2384,20 +2435,34 @@ impl EntityType {
}, },
LootPool { LootPool {
entries: &[LootPoolEntry { entries: &[LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:gameplay/fishing/fish",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: None, conditions: None,
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}]), }]),
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -3167,7 +3232,10 @@ impl EntityType {
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::DamageSourceProperties, LootCondition::DamageSourceProperties {
expected_source_type: None,
expected_direct_type: Some("minecraft:fireball"),
},
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
]), ]),
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
@ -3476,7 +3544,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
]), ]),
}, },
@ -3507,20 +3584,34 @@ impl EntityType {
}, },
LootPool { LootPool {
entries: &[LootPoolEntry { entries: &[LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:gameplay/fishing/fish",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: None, conditions: None,
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}]), }]),
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -3647,7 +3738,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::EnchantedCountIncrease, content: LootFunctionTypes::EnchantedCountIncrease,
@ -3880,7 +3980,10 @@ impl EntityType {
}), }),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: Some(&[ functions: Some(&[
LootFunction { LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
@ -3932,7 +4035,16 @@ impl EntityType {
conditions: None, conditions: None,
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}]), }]),
}, },
], ],
@ -3940,7 +4052,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -4451,8 +4566,14 @@ impl EntityType {
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[ conditions: Some(&[
LootCondition::Inverted, LootCondition::Inverted(&LootCondition::DamageSourceProperties {
LootCondition::EntityProperties, expected_source_type: Some("minecraft:frog"),
expected_direct_type: None,
}),
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
]), ]),
functions: Some(&[ functions: Some(&[
LootFunction { LootFunction {
@ -4477,7 +4598,10 @@ impl EntityType {
}), }),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::DamageSourceProperties]), conditions: Some(&[LootCondition::DamageSourceProperties {
expected_source_type: Some("minecraft:frog"),
expected_direct_type: None,
}]),
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
count: LootFunctionNumberProvider::Constant { value: 1f32 }, count: LootFunctionNumberProvider::Constant { value: 1f32 },
@ -4492,7 +4616,10 @@ impl EntityType {
}), }),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::DamageSourceProperties]), conditions: Some(&[LootCondition::DamageSourceProperties {
expected_source_type: Some("minecraft:frog"),
expected_direct_type: None,
}]),
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
count: LootFunctionNumberProvider::Constant { value: 1f32 }, count: LootFunctionNumberProvider::Constant { value: 1f32 },
@ -4507,7 +4634,10 @@ impl EntityType {
}), }),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::DamageSourceProperties]), conditions: Some(&[LootCondition::DamageSourceProperties {
expected_source_type: Some("minecraft:frog"),
expected_direct_type: None,
}]),
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
count: LootFunctionNumberProvider::Constant { value: 1f32 }, count: LootFunctionNumberProvider::Constant { value: 1f32 },
@ -4759,7 +4889,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::EnchantedCountIncrease, content: LootFunctionTypes::EnchantedCountIncrease,
@ -4916,7 +5055,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}]), }]),
@ -5549,7 +5691,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::EnchantedCountIncrease, content: LootFunctionTypes::EnchantedCountIncrease,
@ -5735,7 +5886,10 @@ impl EntityType {
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}]), }]),
}), }),
@ -5826,7 +5980,16 @@ impl EntityType {
functions: Some(&[ functions: Some(&[
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
@ -5854,7 +6017,16 @@ impl EntityType {
functions: Some(&[ functions: Some(&[
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
@ -6063,7 +6235,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::EnchantedCountIncrease, content: LootFunctionTypes::EnchantedCountIncrease,
@ -6090,7 +6271,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -6224,7 +6408,16 @@ impl EntityType {
conditions: None, conditions: None,
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}]), }]),
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
@ -6319,7 +6512,16 @@ impl EntityType {
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}, },
LootFunction { LootFunction {
content: LootFunctionTypes::EnchantedCountIncrease, content: LootFunctionTypes::EnchantedCountIncrease,
@ -6337,115 +6539,195 @@ impl EntityType {
content: LootPoolEntryTypes::Alternatives(AlternativeEntry { content: LootPoolEntryTypes::Alternatives(AlternativeEntry {
children: &[ children: &[
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/white",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/orange",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/magenta",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/light_blue",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/yellow",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/lime",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/pink",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/gray",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/light_gray",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/cyan",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/purple",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/blue",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/brown",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/green",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/red",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
LootPoolEntry { LootPoolEntry {
content: LootPoolEntryTypes::LootTable, content: LootPoolEntryTypes::LootTable(LootTableEntry {
value: "minecraft:entities/sheep/black",
}),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}, },
], ],
@ -6521,7 +6803,10 @@ impl EntityType {
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[LootCondition::RandomChanceWithEnchantedBonus]), conditions: Some(&[LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
}]),
functions: None, functions: None,
}]), }]),
}), }),
@ -6843,7 +7128,12 @@ impl EntityType {
}), }),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::Inverted]), conditions: Some(&[LootCondition::Inverted(
&LootCondition::DamageSourceProperties {
expected_source_type: Some("minecraft:frog"),
expected_direct_type: None,
},
)]),
functions: Some(&[ functions: Some(&[
LootFunction { LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
@ -6867,7 +7157,10 @@ impl EntityType {
}), }),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::DamageSourceProperties]), conditions: Some(&[LootCondition::DamageSourceProperties {
expected_source_type: Some("minecraft:frog"),
expected_direct_type: None,
}]),
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
count: LootFunctionNumberProvider::Constant { value: 1f32 }, count: LootFunctionNumberProvider::Constant { value: 1f32 },
@ -6879,7 +7172,10 @@ impl EntityType {
], ],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: None, functions: None,
}]), }]),
}), }),
@ -7966,7 +8262,10 @@ impl EntityType {
}], }],
rolls: LootNumberProviderTypes::Constant(1f32), rolls: LootNumberProviderTypes::Constant(1f32),
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[LootCondition::DamageSourceProperties]), conditions: Some(&[LootCondition::DamageSourceProperties {
expected_source_type: None,
expected_direct_type: None,
}]),
functions: None, functions: None,
}, },
]), ]),
@ -8696,7 +8995,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -8941,7 +9243,10 @@ impl EntityType {
}), }),
weight: 1i32, weight: 1i32,
quality: 0i32, quality: 0i32,
conditions: Some(&[LootCondition::EntityProperties]), conditions: Some(&[LootCondition::EntityProperties {
entity: "this",
expected_type: None,
}]),
functions: Some(&[ functions: Some(&[
LootFunction { LootFunction {
content: LootFunctionTypes::SetCount { content: LootFunctionTypes::SetCount {
@ -8993,7 +9298,16 @@ impl EntityType {
conditions: None, conditions: None,
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}]), }]),
}, },
], ],
@ -9001,7 +9315,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -9019,7 +9336,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::EntityProperties, LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -9293,7 +9613,16 @@ impl EntityType {
conditions: None, conditions: None,
functions: Some(&[LootFunction { functions: Some(&[LootFunction {
content: LootFunctionTypes::FurnaceSmelt, content: LootFunctionTypes::FurnaceSmelt,
conditions: Some(&[LootCondition::AnyOf]), conditions: Some(&[LootCondition::AnyOf(&[
LootCondition::EntityProperties {
entity: "this",
expected_type: None,
},
LootCondition::EntityProperties {
entity: "direct_attacker",
expected_type: None,
},
])]),
}]), }]),
}, },
], ],
@ -9301,7 +9630,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },
@ -9431,7 +9763,10 @@ impl EntityType {
bonus_rolls: LootNumberProviderTypes::Constant(0f32), bonus_rolls: LootNumberProviderTypes::Constant(0f32),
conditions: Some(&[ conditions: Some(&[
LootCondition::KilledByPlayer, LootCondition::KilledByPlayer,
LootCondition::RandomChanceWithEnchantedBonus, LootCondition::RandomChanceWithEnchantedBonus {
enchantment: "minecraft:looting",
chances: None,
},
]), ]),
functions: None, functions: None,
}, },

View File

@ -7,7 +7,16 @@ license.workspace = true
[dependencies] [dependencies]
pumpkin-protocol.workspace = true pumpkin-protocol.workspace = true
pumpkin-data.workspace = true pumpkin-data = { workspace = true, features = [
"item",
"screen",
"data_component",
"recipes",
"tag",
"fuels",
"enchantment",
"potion",
] }
pumpkin-world.workspace = true pumpkin-world.workspace = true
pumpkin-util.workspace = true pumpkin-util.workspace = true

View File

@ -60,11 +60,16 @@ pub struct GroupEntry {
pub children: &'static [LootPoolEntry], pub children: &'static [LootPoolEntry],
} }
#[derive(Clone, Debug)]
pub struct LootTableEntry {
pub value: &'static str,
}
#[derive(Clone, Debug)] #[derive(Clone, Debug)]
pub enum LootPoolEntryTypes { pub enum LootPoolEntryTypes {
Empty, Empty,
Item(ItemEntry), Item(ItemEntry),
LootTable, LootTable(LootTableEntry),
Dynamic, Dynamic,
Tag(TagEntry), Tag(TagEntry),
Alternatives(AlternativeEntry), Alternatives(AlternativeEntry),
@ -76,21 +81,27 @@ pub enum LootPoolEntryTypes {
#[derive(Clone, PartialEq, Debug)] #[derive(Clone, PartialEq, Debug)]
pub enum LootCondition { pub enum LootCondition {
/// Inverts the result of another condition. /// Inverts the result of another condition.
Inverted, Inverted(&'static Self),
/// Passes if any of the given conditions are met. /// Passes if any of the given conditions are met.
AnyOf, AnyOf(&'static [Self]),
/// Passes only if all the given conditions are met. /// Passes only if all the given conditions are met.
AllOf, AllOf(&'static [Self]),
/// Passes based on a random chance. /// Passes based on a random chance.
RandomChance { chance: f32 }, RandomChance { chance: f32 },
/// Passes based on a random chance modified by item enchantments. /// Passes based on a random chance modified by item enchantments.
RandomChanceWithEnchantedBonus, RandomChanceWithEnchantedBonus {
enchantment: &'static str,
chances: Option<&'static [f32]>,
},
/// Checks properties of the entity (e.g. type, attributes). /// Checks properties of the entity (e.g. type, attributes).
EntityProperties, EntityProperties {
entity: &'static str,
expected_type: Option<&'static str>,
},
/// Requires the entity to have been killed by a player. /// Requires the entity to have been killed by a player.
KilledByPlayer, KilledByPlayer,
/// Checks entity scores against specified criteria. /// Checks entity scores against specified criteria.
EntityScores, EntityScores { entity: &'static str },
/// Checks block state properties. /// Checks block state properties.
BlockStateProperty { BlockStateProperty {
/// The block to check. /// The block to check.
@ -99,25 +110,47 @@ pub enum LootCondition {
properties: &'static [(&'static str, &'static str)], properties: &'static [(&'static str, &'static str)],
}, },
/// Requires a specific tool to match certain criteria. /// Requires a specific tool to match certain criteria.
MatchTool, MatchTool {
items: Option<&'static [&'static str]>,
},
/// Applies a bonus based on a table. /// Applies a bonus based on a table.
TableBonus, TableBonus {
enchantment: &'static str,
chances: &'static [f32],
},
/// Survives explosion damage. /// Survives explosion damage.
SurvivesExplosion, SurvivesExplosion,
/// Checks properties of the damage source. /// Checks properties of the damage source.
DamageSourceProperties, DamageSourceProperties {
expected_source_type: Option<&'static str>,
expected_direct_type: Option<&'static str>,
},
/// Checks the location of the entity. /// Checks the location of the entity.
LocationCheck, LocationCheck {
offset_x: i32,
offset_y: i32,
offset_z: i32,
expected_biome: Option<&'static str>,
},
/// Checks weather conditions. /// Checks weather conditions.
WeatherCheck, WeatherCheck {
raining: Option<bool>,
thundering: Option<bool>,
},
/// References to another condition or table. /// References to another condition or table.
Reference, Reference { name: &'static str },
/// Checks the in-game time. /// Checks the in-game time.
TimeCheck, TimeCheck {
range: (Option<f32>, Option<f32>),
period: Option<u64>,
},
/// Checks against a specific value or range. /// Checks against a specific value or range.
ValueCheck, ValueCheck {
value: LootNumberProviderTypes,
range: (Option<f32>, Option<f32>),
},
/// Checks if a specific enchantment is active. /// Checks if a specific enchantment is active.
EnchantmentActiveCheck, EnchantmentActiveCheck { active: bool },
} }
/// Functions applied to loot entries. /// Functions applied to loot entries.

View File

@ -25,8 +25,8 @@ pumpkin-nbt.workspace = true
pumpkin-config.workspace = true pumpkin-config.workspace = true
pumpkin-inventory.workspace = true pumpkin-inventory.workspace = true
pumpkin-world.workspace = true pumpkin-world.workspace = true
pumpkin-data.workspace = true pumpkin-data = { workspace = true, features = ["default"] }
pumpkin-protocol.workspace = true pumpkin-protocol = { workspace = true, features = ["default"] }
pumpkin-macros.workspace = true pumpkin-macros.workspace = true
pumpkin-codecs.workspace = true pumpkin-codecs.workspace = true
@ -92,8 +92,8 @@ rustc-hash.workspace = true
tokio-util = { workspace = true, features = ["rt"] } tokio-util = { workspace = true, features = ["rt"] }
# System details & Rustc version # System details & Rustc version
sysinfo = "0.39" sysinfo.workspace = true
rustc_version_runtime = "0.3" rustc_version_runtime.workspace = true
flate2.workspace = true flate2.workspace = true
console-subscriber = { workspace = true, optional = true } console-subscriber = { workspace = true, optional = true }
@ -103,7 +103,7 @@ wasmtime-wasi = { workspace = true }
wasmtime-wasi-http = { workspace = true } wasmtime-wasi-http = { workspace = true }
hyper = { workspace = true } hyper = { workspace = true }
ordered-float = "5.3.0" ordered-float.workspace = true
postcard = { workspace = true } postcard = { workspace = true }
tracing-serde-structured = { workspace = true } tracing-serde-structured = { workspace = true }

View File

@ -217,7 +217,11 @@ impl CrashReport {
"Operating System: {}", "Operating System: {}",
System::long_os_version().unwrap_or("Unknown".to_string()) System::long_os_version().unwrap_or("Unknown".to_string())
); );
writeln_output!(&mut output, "Kernel: {}", System::kernel_long_version()); writeln_output!(
&mut output,
"Kernel: {}",
System::kernel_version().unwrap_or_else(|| "Unknown".to_string())
);
writeln_output!( writeln_output!(
&mut output, &mut output,
"Physical Memory: {} MiB/{} MiB used, {} MiB free", "Physical Memory: {} MiB/{} MiB used, {} MiB free",

View File

@ -1291,6 +1291,12 @@ impl LivingEntity {
world.send_entity_status(&self.entity, EntityStatus::Death); world.send_entity_status(&self.entity, EntityStatus::Death);
let params = LootContextParameters { let params = LootContextParameters {
killed_by_player: cause.map(|c| c.get_entity().entity_type == &EntityType::PLAYER), killed_by_player: cause.map(|c| c.get_entity().entity_type == &EntityType::PLAYER),
this_entity: Some(self.entity.entity_type),
killer_entity: cause.map(|c| c.get_entity().entity_type),
direct_killer_entity: source.map(|s| s.get_entity().entity_type),
position: Some(self.entity.pos.load()),
world_time: world.level_info.load().day_time as u64,
damage_type: Some(damage_type),
..Default::default() ..Default::default()
}; };

View File

@ -223,6 +223,12 @@ impl Explosion {
let params = LootContextParameters { let params = LootContextParameters {
block_state: Some(state), block_state: Some(state),
explosion_radius: Some(self.power), explosion_radius: Some(self.power),
position: Some(pumpkin_util::math::vector3::Vector3::new(
pos.0.x as f64,
pos.0.y as f64,
pos.0.z as f64,
)),
world_time: world.level_info.load().day_time as u64,
..Default::default() ..Default::default()
}; };
drop_loot(world, block, pos, false, params).await; drop_loot(world, block, pos, false, params).await;

View File

@ -1,10 +1,12 @@
use pumpkin_data::damage::DamageType;
use pumpkin_data::entity::EntityType;
use pumpkin_data::item_stack::ItemStack; use pumpkin_data::item_stack::ItemStack;
use pumpkin_data::tag; use pumpkin_data::tag;
use pumpkin_data::{Block, BlockState, item::Item}; use pumpkin_data::{Block, BlockState, item::Item};
use pumpkin_util::{ use pumpkin_util::{
loot_table::{ loot_table::{
LootCondition, LootFunctionNumberProvider, LootFunctionTypes, LootPoolEntry, LootCondition, LootFunction, LootFunctionBonusParameter, LootFunctionNumberProvider,
LootPoolEntryTypes, LootTable, LootFunctionTypes, LootPoolEntry, LootPoolEntryTypes, LootTable,
}, },
random::{RandomGenerator, RandomImpl, get_seed, xoroshiro128::Xoroshiro}, random::{RandomGenerator, RandomImpl, get_seed, xoroshiro128::Xoroshiro},
}; };
@ -16,6 +18,12 @@ pub struct LootContextParameters {
pub block_state: Option<&'static BlockState>, pub block_state: Option<&'static BlockState>,
pub killed_by_player: Option<bool>, pub killed_by_player: Option<bool>,
pub luck: f32, pub luck: f32,
pub this_entity: Option<&'static EntityType>,
pub killer_entity: Option<&'static EntityType>,
pub direct_killer_entity: Option<&'static EntityType>,
pub position: Option<pumpkin_util::math::vector3::Vector3<f64>>,
pub world_time: u64,
pub damage_type: Option<DamageType>,
} }
pub trait LootTableExt { pub trait LootTableExt {
@ -86,6 +94,132 @@ trait LootPoolEntryExt {
fn get_loot(&self, params: &LootContextParameters) -> Option<Vec<ItemStack>>; fn get_loot(&self, params: &LootContextParameters) -> Option<Vec<ItemStack>>;
} }
trait LootFunctionExt {
fn apply(&self, stacks: &mut Vec<ItemStack>, params: &LootContextParameters);
}
fn apply_bonus(
stacks: &mut [ItemStack],
formula: &str,
parameters: Option<&LootFunctionBonusParameter>,
) {
// We currently don't have tool/enchantment data in LootContextParameters.
// Assuming enchantment level is 0 for now.
let enchantment_level = 0;
if enchantment_level > 0 {
for stack in stacks {
match formula {
"minecraft:binomial_with_bonus_count" => {
if let Some(LootFunctionBonusParameter::Probability { extra, probability }) =
parameters
{
let n = enchantment_level + *extra;
let mut extra_items = 0;
for _ in 0..n {
if rand::rng().random::<f32>() < *probability {
extra_items += 1;
}
}
stack.item_count = stack.item_count.saturating_add(extra_items as u8);
}
}
"minecraft:uniform_bonus_count" => {
if let Some(LootFunctionBonusParameter::Multiplier { bonus_multiplier }) =
parameters
{
let extra =
rand::rng().random_range(0..=(enchantment_level * *bonus_multiplier));
stack.item_count = stack.item_count.saturating_add(extra as u8);
}
}
"minecraft:ore_drops" if enchantment_level > 0 => {
let multiplier = rand::rng().random_range(0..=(enchantment_level + 1));
if multiplier > 0 {
stack.item_count = stack.item_count.saturating_mul(multiplier as u8);
}
}
_ => {}
}
}
}
}
impl LootFunctionExt for LootFunction {
fn apply(&self, stacks: &mut Vec<ItemStack>, params: &LootContextParameters) {
if let Some(conditions) = self.conditions
&& !conditions.iter().all(|cond| cond.is_fulfilled(params))
{
return;
}
match &self.content {
LootFunctionTypes::SetCount { count, add } => {
for stack in stacks {
if *add {
stack.item_count += count.generate().round() as u8;
} else {
stack.item_count = count.generate().round() as u8;
}
}
}
LootFunctionTypes::LimitCount { min, max } => {
if let Some(min) = min.map(|min| min.round() as u8) {
for stack in stacks.iter_mut() {
if stack.item_count < min {
stack.item_count = min;
}
}
}
if let Some(max) = max.map(|max| max.round() as u8) {
for stack in stacks.iter_mut() {
if stack.item_count > max {
stack.item_count = max;
}
}
}
}
LootFunctionTypes::ExplosionDecay => {
if let Some(radius) = params.explosion_radius {
let survival_chance = 1.0 / radius;
for stack in stacks.iter_mut() {
let mut survived = 0;
for _ in 0..stack.item_count {
if rand::rng().random::<f32>() <= survival_chance {
survived += 1;
}
}
stack.item_count = survived;
}
// Remove empty stacks
stacks.retain(|stack| stack.item_count > 0);
}
}
LootFunctionTypes::ApplyBonus {
enchantment: _,
formula,
parameters,
} => {
apply_bonus(stacks, formula, parameters.as_ref());
}
LootFunctionTypes::CopyComponents {
source: _,
include: _,
}
| LootFunctionTypes::CopyState {
block: _,
properties: _,
}
| LootFunctionTypes::EnchantedCountIncrease
| LootFunctionTypes::SetOminousBottleAmplifier
| LootFunctionTypes::SetPotion
| LootFunctionTypes::FurnaceSmelt => {
// TODO: shouldnt crash here but needs to be implemented someday
}
}
}
}
impl LootPoolEntryExt for LootPoolEntry { impl LootPoolEntryExt for LootPoolEntry {
fn get_loot(&self, params: &LootContextParameters) -> Option<Vec<ItemStack>> { fn get_loot(&self, params: &LootContextParameters) -> Option<Vec<ItemStack>> {
if let Some(conditions) = self.conditions if let Some(conditions) = self.conditions
@ -98,60 +232,7 @@ impl LootPoolEntryExt for LootPoolEntry {
if let Some(functions) = self.functions { if let Some(functions) = self.functions {
for function in functions { for function in functions {
if let Some(conditions) = function.conditions function.apply(&mut stacks, params);
&& !conditions.iter().all(|cond| cond.is_fulfilled(params))
{
continue;
}
match &function.content {
LootFunctionTypes::SetCount { count, add } => {
for stack in &mut stacks {
if *add {
stack.item_count += count.generate().round() as u8;
} else {
stack.item_count = count.generate().round() as u8;
}
}
}
LootFunctionTypes::LimitCount { min, max } => {
if let Some(min) = min.map(|min| min.round() as u8) {
for stack in &mut stacks {
if stack.item_count < min {
stack.item_count = min;
}
}
}
if let Some(max) = max.map(|max| max.round() as u8) {
for stack in &mut stacks {
if stack.item_count > max {
stack.item_count = max;
}
}
}
}
LootFunctionTypes::ApplyBonus {
enchantment: _,
formula: _,
parameters: _,
}
| LootFunctionTypes::CopyComponents {
source: _,
include: _,
}
| LootFunctionTypes::CopyState {
block: _,
properties: _,
}
| LootFunctionTypes::EnchantedCountIncrease
| LootFunctionTypes::SetOminousBottleAmplifier
| LootFunctionTypes::SetPotion
| LootFunctionTypes::FurnaceSmelt
| LootFunctionTypes::ExplosionDecay => {
// TODO: shouldnt crash here but needs to be implemented someday
}
}
} }
} }
@ -166,7 +247,20 @@ trait LootPoolEntryTypesExt {
impl LootPoolEntryTypesExt for LootPoolEntryTypes { impl LootPoolEntryTypesExt for LootPoolEntryTypes {
fn get_stacks(&self, params: &LootContextParameters) -> Vec<ItemStack> { fn get_stacks(&self, params: &LootContextParameters) -> Vec<ItemStack> {
match self { match self {
Self::Empty | Self::LootTable | Self::Dynamic => Vec::new(), Self::Empty | Self::Dynamic => Vec::new(),
Self::LootTable(entry) => {
let key = entry
.value
.strip_prefix("minecraft:")
.unwrap_or(entry.value);
// First try chest loot tables.
pumpkin_data::chest_loot_table::get_chest_loot_table(&format!("minecraft:{key}"))
.map_or_else(Vec::new, |chest_table| {
// We don't have a seed here, but we can generate a random one.
let seed: i64 = rand::random();
generate_chest_loot(chest_table, seed)
})
}
Self::Item(item_entry) => { Self::Item(item_entry) => {
let key = &item_entry.name.strip_prefix("minecraft:").unwrap(); let key = &item_entry.name.strip_prefix("minecraft:").unwrap();
vec![ItemStack::new(1, Item::from_registry_key(key).unwrap())] vec![ItemStack::new(1, Item::from_registry_key(key).unwrap())]
@ -243,6 +337,63 @@ trait LootConditionExt {
fn is_fulfilled(&self, params: &LootContextParameters) -> bool; fn is_fulfilled(&self, params: &LootContextParameters) -> bool;
} }
fn compare_entity_type(expected_type: &str, actual: &EntityType) -> bool {
let expected = expected_type
.strip_prefix("minecraft:")
.unwrap_or(expected_type);
let actual = actual
.resource_name
.strip_prefix("minecraft:")
.unwrap_or(actual.resource_name);
expected == actual
}
fn check_block_state_property(state: &BlockState, properties: &[(&str, &str)]) -> bool {
let block_actual_properties = match Block::properties(Block::from_state_id(state.id), state.id)
{
Some(props_data) => props_data.to_props(), // Assuming to_props() returns HashMap<String, String>
None => {
return properties.is_empty();
}
};
properties.iter().all(|(expected_key, expected_value)| {
block_actual_properties
.iter()
.find(|(actual_key, _)| actual_key == expected_key)
.is_some_and(|(_, actual_value_string)| actual_value_string == expected_value)
})
}
fn check_damage_source_properties(
params: &LootContextParameters,
expected_source_type: Option<&str>,
expected_direct_type: Option<&str>,
) -> bool {
if params.damage_type.is_none() {
return false;
}
if let Some(expected) = expected_source_type {
if let Some(actual) = params.killer_entity {
if !compare_entity_type(expected, actual) {
return false;
}
} else {
return false;
}
}
if let Some(expected) = expected_direct_type {
if let Some(actual) = params.direct_killer_entity {
if !compare_entity_type(expected, actual) {
return false;
}
} else {
return false;
}
}
true
}
impl LootConditionExt for LootCondition { impl LootConditionExt for LootCondition {
// TODO: This is trash. Make this right // TODO: This is trash. Make this right
fn is_fulfilled(&self, params: &LootContextParameters) -> bool { fn is_fulfilled(&self, params: &LootContextParameters) -> bool {
@ -254,32 +405,85 @@ impl LootConditionExt for LootCondition {
true true
} }
Self::RandomChance { chance } => rand::rng().random::<f32>() < *chance, Self::RandomChance { chance } => rand::rng().random::<f32>() < *chance,
Self::EntityProperties {
entity,
expected_type,
} => {
let target = match *entity {
"this" => params.this_entity,
"killer" | "direct_killer" => params.killer_entity,
_ => None,
};
if let Some(target) = target {
if let Some(expected_type) = expected_type {
return compare_entity_type(expected_type, target);
}
true
} else {
false
}
}
Self::KilledByPlayer => params.killed_by_player.unwrap_or(false), Self::KilledByPlayer => params.killed_by_player.unwrap_or(false),
Self::BlockStateProperty { Self::BlockStateProperty {
block: _, block: _,
properties, properties,
} => { } => {
if let Some(state) = &params.block_state { if let Some(state) = &params.block_state {
let block_actual_properties = return check_block_state_property(state, properties);
match Block::properties(Block::from_state_id(state.id), state.id) {
Some(props_data) => props_data.to_props(), // Assuming to_props() returns HashMap<String, String>
None => {
return properties.is_empty();
}
};
return properties.iter().all(|(expected_key, expected_value)| {
block_actual_properties
.iter()
.find(|(actual_key, _)| actual_key == expected_key)
.is_some_and(|(_, actual_value_string)| {
actual_value_string == expected_value
})
});
} }
false false
} }
_ => false, Self::Inverted(term) => !term.is_fulfilled(params),
Self::AnyOf(terms) => terms.iter().any(|cond| cond.is_fulfilled(params)),
Self::AllOf(terms) => terms.iter().all(|cond| cond.is_fulfilled(params)),
Self::RandomChanceWithEnchantedBonus {
enchantment: _,
chances,
} => chances.as_ref().is_some_and(|chances| {
// Missing tool context in params, assume enchantment level 0
let level = 0;
let chance = chances.get(level).unwrap_or(chances.last().unwrap_or(&0.0));
rand::rng().random::<f32>() < *chance
}),
Self::TableBonus {
enchantment: _,
chances,
} => {
// Missing tool context in params, assume enchantment level 0
let level = 0;
let chance = chances.get(level).unwrap_or(chances.last().unwrap_or(&0.0));
rand::rng().random::<f32>() < *chance
}
Self::EntityScores { .. }
| Self::WeatherCheck { .. }
| Self::MatchTool { .. }
| Self::Reference { .. }
| Self::EnchantmentActiveCheck { .. }
| Self::LocationCheck { .. } => {
// TODO: Implement these
true
}
Self::TimeCheck { range, period } => {
let mut time = params.world_time;
if let Some(period) = period {
time %= period;
}
let (min, max) = range;
let val = time as f32;
min.is_none_or(|min| val >= min) && max.is_none_or(|max| val <= max)
}
Self::ValueCheck { value, range } => {
let mut rng = Xoroshiro::from_seed(get_seed());
let val = value.get(&mut rng);
let (min, max) = range;
min.is_none_or(|min| val >= min) && max.is_none_or(|max| val <= max)
}
Self::DamageSourceProperties {
expected_source_type,
expected_direct_type,
} => {
check_damage_source_properties(params, *expected_source_type, *expected_direct_type)
}
} }
} }
} }
@ -304,20 +508,15 @@ impl LootFunctionNumberProviderExt for LootFunctionNumberProvider {
} }
} }
/// Fills a chest inventory with items generated from a static `ChestLootTable`, using a /// Generates a list of items from a `ChestLootTable` using a deterministic seed.
/// deterministic seed for deferred loot chests. #[must_use]
/// pub fn generate_chest_loot(
/// Items are scattered randomly across the 27 chest slots.
pub async fn fill_chest_inventory(
inventory: &std::sync::Arc<dyn pumpkin_world::inventory::Inventory>,
table: &pumpkin_util::chest_loot_table::ChestLootTable, table: &pumpkin_util::chest_loot_table::ChestLootTable,
seed: i64, seed: i64,
) { ) -> Vec<ItemStack> {
use pumpkin_util::random::RandomImpl; use pumpkin_util::random::RandomImpl;
let mut rng = Xoroshiro::from_seed(seed as u64); let mut rng = Xoroshiro::from_seed(seed as u64);
let inv_size = inventory.size(); // 27 for a normal chest
let mut items_to_place: Vec<ItemStack> = Vec::new(); let mut items_to_place: Vec<ItemStack> = Vec::new();
for pool in table.pools { for pool in table.pools {
@ -367,11 +566,23 @@ pub async fn fill_chest_inventory(
} }
} }
items_to_place
}
/// Items are scattered randomly across the 27 chest slots.
pub async fn fill_chest_inventory(
inventory: &std::sync::Arc<dyn pumpkin_world::inventory::Inventory>,
table: &pumpkin_util::chest_loot_table::ChestLootTable,
seed: i64,
) {
let mut items_to_place = generate_chest_loot(table, seed);
if items_to_place.is_empty() { if items_to_place.is_empty() {
return; return;
} }
// Count free slots in the inventory. let inv_size = inventory.size(); // 27 for a normal chest
let mut rng = Xoroshiro::from_seed(seed as u64);
let free_slots = inv_size; let free_slots = inv_size;
// Split large stacks across extra slots then shuffle. // Split large stacks across extra slots then shuffle.

View File

@ -3600,6 +3600,12 @@ impl World {
let params = LootContextParameters { let params = LootContextParameters {
block_state: Some(BlockState::from_id(broken_state_id)), block_state: Some(BlockState::from_id(broken_state_id)),
luck, luck,
position: Some(pumpkin_util::math::vector3::Vector3::new(
position.0.x as f64,
position.0.y as f64,
position.0.z as f64,
)),
world_time: self.level_info.load().day_time as u64,
..Default::default() ..Default::default()
}; };
block::drop_loot(self, broken_block, position, true, params).await; block::drop_loot(self, broken_block, position, true, params).await;