diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 98d5b9093..eff82fa99 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,7 +3,8 @@ name: checks
# check main requires, so it never has a condition: a skipped job counts as passed, and every run of this workflow
# must report a real verify (a pull request that changes no Rust finishes it in seconds instead).
# parity: the vanilla harnesses a pull request's changes can affect, on the Mac mini's runner, which holds the
-# maintainer's own Minecraft files (Horizon never downloads the game); .github/workflows/parity.yml. A fork's pull
+# maintainer's own Minecraft files (Horizon never downloads the game); .github/workflows/parity.yml. Only for a pull
+# request that changes a harness, oracle, probe or the runner: the rest are checked on main by parity-main. A fork's pull
# request runs it only when a maintainer adds the run-parity label (.github/workflows/run-parity.yml), so labels
# never start this workflow. See docs/release-flow.md.
on:
@@ -72,8 +73,37 @@ jobs:
run: |
cargo +stable test --workspace --lib --bins --tests --features horizon-client/mods,horizon-mods/pack
cargo +stable test --workspace --doc --features horizon-client/mods,horizon-mods/pack
- parity:
+ # Most pull requests leave the harnesses to parity-main, which runs them on main a batch of merges at a time
+ # (.github/workflows/parity-main.yml; releases wait for it). A pull request still runs them itself when it changes
+ # a harness, an oracle, a probe or the runner, or carries the run-parity label (run-parity.yml, when it is added).
+ parity-scope:
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
+ runs-on: ubuntu-latest
+ outputs:
+ run: ${{ steps.scope.outputs.run }}
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ - id: scope
+ env:
+ BASE_SHA: ${{ github.event.pull_request.base.sha }}
+ LABELS: ${{ join(github.event.pull_request.labels.*.name, ' ') }}
+ run: |
+ changed=$(git diff --name-only "$(git merge-base "$BASE_SHA" HEAD)" HEAD)
+ harness=$(grep -E '^(tools/test_[a-z0-9_]+_parity\.py|tools/(parity[a-z_]*|lab)\.py|tools/parity_hosts\.json|mods/horizon/src/test/|crates/[^/]+/examples/|crates/horizon-client/src/game/[a-z_]*(fixture|harness)\.rs|\.github/workflows/parity[a-z-]*\.yml)' <<< "$changed" || true)
+ if [ -n "$harness" ] || [[ " $LABELS " == *" run-parity "* ]]; then
+ echo "run=true" >> "$GITHUB_OUTPUT"
+ echo "The pull request runs its harnesses: ${harness:-label run-parity}"
+ else
+ echo "run=false" >> "$GITHUB_OUTPUT"
+ echo "No harness, oracle, probe or runner change: parity-main checks this on main"
+ fi
+ parity:
+ needs: parity-scope
+ if: needs.parity-scope.outputs.run == 'true'
uses: ./.github/workflows/parity.yml
with:
base: ${{ github.event.pull_request.base.sha }}
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index 51f9e89cd..60bbbf057 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -29,7 +29,8 @@ env:
jobs:
audit:
- runs-on: [self-hosted, horizon-game]
+ # The Mac mini's runners only: the audit compares with the previous one, so it stays on one platform.
+ runs-on: [self-hosted, horizon-game, macOS]
timeout-minutes: 150
steps:
- name: 03:00 in Paris
diff --git a/.github/workflows/parity-main.yml b/.github/workflows/parity-main.yml
new file mode 100644
index 000000000..13be3c36d
--- /dev/null
+++ b/.github/workflows/parity-main.yml
@@ -0,0 +1,74 @@
+name: parity-main
+# The vanilla harnesses on main, a batch of merges at a time (docs/release-flow.md#parity-on-main), on the Mac mini's
+# runner. One run at a time: merges that land while a run goes on wait in one pending run (GitHub keeps only the
+# newest), which checks every merge since main's last green parity-main (tools/parity_main.py base). On a failure it
+# bisects the failing harnesses over those merges and comments on the pull request that broke them. Releases ship
+# only a commit whose parity-main passed (tools/release_train.py), so nothing a harness catches reaches players.
+on:
+ push:
+ branches: [main]
+ workflow_dispatch:
+permissions:
+ contents: read
+ # The comment on the merge that broke a harness.
+ pull-requests: write
+ # tools/parity_main.py base reads earlier runs.
+ actions: read
+concurrency:
+ group: parity-main
+ cancel-in-progress: false
+env:
+ # Test runs never reach the telemetry server: no live-count ping, no uploads (docs/telemetry.md).
+ HORIZON_TELEMETRY_URL: "off"
+
+jobs:
+ parity-main:
+ # The Mac mini's release runner (label added 2026-10-26), not the two `horizon-game` runners: behind PR parity jobs
+ # this run waited 2 h while every merge replaced the pending one, and releases wait for it. Releases need it green
+ # first, so the two never compete. Not the desktop: a job slowed down because the maintainer came back could time
+ # out, and a failure here bisects and comments on merges.
+ runs-on: [self-hosted, macOS, horizon-parity-main]
+ timeout-minutes: 240 # a core-crate batch reruns ~300 harnesses (~60-90 min), a bisect a few rounds of the failures
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ github.sha }}
+ fetch-depth: 0
+ persist-credentials: false
+ # Keeps .local/ (parity state, probe builds, oracle results) and target/ between runs.
+ clean: false
+ - uses: dtolnay/rust-toolchain@stable
+ - name: Tools from the runner
+ run: bash tools/ci/runner-env.sh
+ - name: Vanilla data, and resources prepared by this preparer
+ run: bash tools/ci/vanilla-data.sh
+ - name: Main's last green parity-main
+ id: base
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: echo "sha=$(python3 tools/parity_main.py base)" >> "$GITHUB_OUTPUT"
+ - name: The harnesses the merges since then can affect
+ env:
+ PARITY_HOSTS: ''
+ BASE_SHA: ${{ steps.base.outputs.sha }}
+ run: |
+ echo "Merges since ${BASE_SHA}:"
+ git log --first-parent --format=' %h %s' "$BASE_SHA..HEAD"
+ python3 tools/parity.py --changed "$BASE_SHA" --timeout 2400
+ - name: The merge that broke them
+ if: failure()
+ env:
+ GH_TOKEN: ${{ github.token }}
+ PARITY_HOSTS: ''
+ BASE_SHA: ${{ steps.base.outputs.sha }}
+ run: |
+ rm -rf .local/parity-main-logs && cp -R .local/parity-runner/logs .local/parity-main-logs 2>/dev/null || true
+ python3 tools/parity_main.py bisect "$BASE_SHA" --comment
+ - name: Logs of the failed harnesses
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: parity-main-logs
+ path: .local/parity-main-logs/
+ if-no-files-found: ignore
+ retention-days: 7
diff --git a/.github/workflows/parity.yml b/.github/workflows/parity.yml
index a18fc5019..b48be1d05 100644
--- a/.github/workflows/parity.yml
+++ b/.github/workflows/parity.yml
@@ -36,14 +36,69 @@ jobs:
- name: Tools from the runner
run: bash tools/ci/runner-env.sh
- name: Vanilla data, and resources prepared by this preparer
- run: bash tools/ci/vanilla-data.sh
+ env:
+ BASE_SHA: ${{ inputs.base }}
+ run: |
+ # main's script: one written before a fix to it left a real .local/horizon-client without sounds.json on
+ # the runner, and every later job there failed `subtitle`. A branch that changes the script runs its own.
+ set -euo pipefail
+ if git rev-parse --verify -q origin/main >/dev/null \
+ && git diff --quiet "$(git merge-base "$BASE_SHA" HEAD)" HEAD -- tools/ci/vanilla-data.sh; then
+ git show origin/main:tools/ci/vanilla-data.sh > "$RUNNER_TEMP/vanilla-data.sh"
+ bash "$RUNNER_TEMP/vanilla-data.sh"
+ else
+ bash tools/ci/vanilla-data.sh
+ fi
+ - name: The prepared output is the one the preparer's OUTPUT_VERSION says
+ env:
+ BASE_SHA: ${{ inputs.base }}
+ run: python3 tools/prepare_output.py check --cache --base "$BASE_SHA"
- name: The version constants are the pinned jar's
run: python3 tools/gen_version_consts.py --check
- name: The harnesses this change can affect
env:
PARITY_HOSTS: ''
BASE_SHA: ${{ inputs.base }}
- run: python3 tools/parity.py --changed "$BASE_SHA" --timeout 2400 # world_spawn takes ~1480 s on a busy runner
+ run: |
+ # main's selection (tools/parity.py --changed --list with main's parity.py and parity_reach.py), so a
+ # branch made before a better selection landed gets it too; the head's own runner then runs those
+ # harnesses. A branch that changes the selection itself selects with its own code.
+ set -euo pipefail
+ own() { python3 tools/parity.py --changed "$BASE_SHA" --timeout 2400; } # world_spawn takes ~1480 s on a busy runner
+ fork_point=$(git merge-base "$BASE_SHA" HEAD)
+ if ! git rev-parse --verify -q origin/main >/dev/null || ! git diff --quiet "$fork_point" HEAD -- tools/parity.py tools/parity_reach.py; then
+ own
+ exit
+ fi
+ had_reach=$(git ls-files tools/parity_reach.py)
+ git show origin/main:tools/parity.py > tools/parity.py
+ git show origin/main:tools/parity_reach.py > tools/parity_reach.py
+ status=0
+ python3 tools/parity.py --changed "$BASE_SHA" --list > .local/parity-selection.txt || status=$?
+ git checkout -- tools/parity.py
+ if [ -n "$had_reach" ]; then git checkout -- tools/parity_reach.py; else rm -f tools/parity_reach.py; fi
+ cat .local/parity-selection.txt
+ if [ "$status" != 0 ]; then
+ echo "main's selection failed: the head's own selection runs"
+ own
+ exit
+ fi
+ names=$(sed '$d' .local/parity-selection.txt | grep -E '^[A-Za-z0-9_#]+$' || true)
+ # The summary line says how many would run: a count that doesn't match the names read (a format change)
+ # must not let the job pass untested.
+ expected=$(tail -1 .local/parity-selection.txt | sed -nE 's/^([0-9]+) of [0-9]+ harnesses would run$/\1/p')
+ count=$(printf '%s' "$names" | grep -c . || true)
+ if [ -z "$expected" ] || [ "$expected" != "$count" ]; then
+ echo "main's selection listed $count names, its summary says '${expected:-?}': the head's own selection runs"
+ own
+ exit
+ fi
+ if [ "$count" = 0 ]; then
+ echo "Nothing to run."
+ exit 0
+ fi
+ # shellcheck disable=SC2086
+ python3 tools/parity.py $names --timeout 2400
- name: Logs of the failed harnesses
if: failure()
uses: actions/upload-artifact@v4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 4cba851fa..d879f0d61 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,6 +1,7 @@
name: release
# Automatic game releases (docs/release-flow.md). After every green `checks` run on main, every 10 minutes (so a
-# release waiting for merges to settle goes out without another merge) and by hand, tools/release_train.py decides:
+# release waiting for merges to settle goes out without another merge) and by hand, tools/release_train.py decides,
+# for a commit whose checks and parity-main (the vanilla harnesses on main) both passed:
# a release when 5 pull requests merged since the last one changed what players run and the newest merged 5 minutes
# ago, or when the oldest has waited 6 hours, or at once for a pull request labelled release-now.
# RELEASES_PAUSED=1 (repository variable) stops them; so does an open issue labelled release-blocker, forced runs too.
@@ -18,7 +19,8 @@ name: release
# gh workflow run release -f dry_run=false -f force=true # on main: release now, whatever the rules say
on:
workflow_run:
- workflows: [checks]
+ # A game release ships a commit both passed on (parity-main runs on batches: the newest commit it passed on).
+ workflows: [checks, parity-main]
types: [completed]
branches: [main]
schedule:
@@ -64,8 +66,8 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
RELEASES_PAUSED: ${{ vars.RELEASES_PAUSED }}
- # The commit whose checks just passed; a dry run builds the branch it was started on; otherwise
- # main's newest commit with green checks.
+ # The commit whose checks or parity-main just passed; a dry run builds the branch it was started on;
+ # otherwise main's newest commit with green checks and parity-main.
HEAD_SHA: ${{ github.event.workflow_run.head_sha || (steps.mode.outputs.dry_run == 'true' && github.sha) || '' }}
FORCE: ${{ inputs.force && 'yes' || '' }}
run: |
@@ -77,9 +79,50 @@ jobs:
# A dry run builds whatever the decision, to test the builds.
if [[ "${{ steps.mode.outputs.dry_run }}" == true ]]; then echo "release=true" >> "$GITHUB_OUTPUT"; fi
- build:
+ exporters:
needs: decide
if: needs.decide.outputs.release == 'true'
+ # This runner holds the maintainer's own pinned Minecraft jars. Only our classes leave it.
+ runs-on: ${{ vars.MAC_RUNNER || 'ludovics-mac-mini' }}
+ # Three full preparations (two isolated, one batched) besides the compile.
+ timeout-minutes: 60
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ ref: ${{ needs.decide.outputs.head }}
+ persist-credentials: false
+ clean: true
+ - uses: dtolnay/rust-toolchain@stable
+ - run: bash tools/ci/runner-env.sh
+ - run: bash tools/ci/vanilla-data.sh
+ - name: Compile and validate original exporters against the pinned jars
+ shell: bash
+ run: |
+ set -euo pipefail
+ # target/ is gone after the clean checkout, and vanilla-data.sh builds the preparer only when it
+ # prepares afresh.
+ cargo build --release --locked -p horizon-prepare
+ # Compiled here, never taken from the runner's shared preparations: pull requests' parity jobs
+ # write those (vanilla-data.sh links .local/exporters to them).
+ rm -rf .local/exporters
+ bundle=$(target/release/horizon-prepare compile-exporters --root "$PWD" | tail -1)
+ mkdir -p exporters
+ cp -R "$bundle/server" "$bundle/client" "$bundle/manifest.json" exporters/
+ # Only our classes and their manifest leave this runner.
+ stray=$(find exporters -type f ! -path exporters/manifest.json \
+ ! \( -name '*.class' \( -path 'exporters/server/dev/horizonlab/parity/*' -o -path 'exporters/client/dev/horizonlab/parity/*' \) \))
+ [ -z "$stray" ] || { echo "::error::not one of our classes: $stray"; exit 1; }
+ python3 tools/check_prepare_exporters.py --binary target/release/horizon-prepare
+ - uses: actions/upload-artifact@v4
+ with:
+ name: original-exporters
+ path: exporters/
+ if-no-files-found: error
+ retention-days: 3
+
+ build:
+ needs: [decide, exporters]
+ if: needs.decide.outputs.release == 'true'
name: build ${{ matrix.name }}
strategy:
fail-fast: false
@@ -218,6 +261,10 @@ jobs:
path: ${{ runner.temp }}/smoke-test.json
if-no-files-found: error
retention-days: 3
+ - uses: actions/download-artifact@v4
+ with:
+ name: original-exporters
+ path: exporters
- name: Package
run: |
set -euo pipefail
diff --git a/.gitignore b/.gitignore
index 7fffd6a99..6bdae649a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,6 @@
/.horizon-cache/
/crash-reports/
/debug/
+
+# Release-only compiled original exporter bundle.
+/exporters/
diff --git a/AGENTS.md b/AGENTS.md
index 2d883b33b..549fa5c7f 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -82,7 +82,7 @@ python3 tools/agent_control_e2e.py # horizon-ctl / MCP end to end
~25, a file of the client lib ~103, of `horizon-world` ~103–109, of `horizon-core` ~119. Plan for it.
- Rust integration tests: `crates/horizon-client/tests/` (`lan_bot.rs`, `generation_saves.rs`, `streaming_meshes.rs`).
- **macOS:** `cargo build/test --workspace` may fail to link the two wasm guest cdylibs (undefined
- `horizon:mods/events` symbols) until #1446 lands: add `--exclude coords-hud --exclude horizon-mods-test-guest --exclude horizon-mods-test-ui-guest`.
+ `horizon:mods/events` symbols) until #1446 lands: add `--exclude coords-hud --exclude predator-missile --exclude horizon-mods-test-guest --exclude horizon-mods-test-ui-guest`.
Their real check is `cargo test -p horizon-mods` (builds them for `wasm32-unknown-unknown`).
- Linux needs `libasound2-dev libudev-dev`; `--no-default-features` drops audio and controllers (the server build).
- Run and drive the game (starts the `horizon-client` beside `horizon-ctl`; other arguments go to the game):
diff --git a/Cargo.lock b/Cargo.lock
index 4d749add6..25c1ae15d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -20,9 +20,9 @@ checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618"
[[package]]
name = "addr2line"
-version = "0.25.1"
+version = "0.26.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b5d307320b3181d6d7954e663bd7c774a838b8220fe0593c86d9fb09f498b4b"
+checksum = "59317f77929f0e679d39364702289274de2f0f0b22cbf50b2b8cff2169a0b27a"
dependencies = [
"gimli",
]
@@ -187,6 +187,17 @@ dependencies = [
"libloading",
]
+[[package]]
+name = "async-trait"
+version = "0.1.92"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 3.0.6",
+]
+
[[package]]
name = "atomic-waker"
version = "1.1.2"
@@ -531,7 +542,7 @@ dependencies = [
"jni 0.21.1",
"js-sys",
"libc",
- "mach2",
+ "mach2 0.4.3",
"ndk",
"ndk-context",
"num-derive",
@@ -545,6 +556,15 @@ dependencies = [
"windows 0.54.0",
]
+[[package]]
+name = "cpp_demangle"
+version = "0.5.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0667304c32ea56cb4cd6d2d7c0cfe9a2f8041229db8c033af7f8d69492429def"
+dependencies = [
+ "cfg-if",
+]
+
[[package]]
name = "cpufeatures"
version = "0.2.17"
@@ -556,46 +576,48 @@ dependencies = [
[[package]]
name = "cranelift-assembler-x64"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e92993516bcc43fd4e511b31d2e0c0c24f6b7ac18bb39e32cac2bfc05ea378e"
+checksum = "e6071a4f1df4837aa03d1e4d53067784acafe270ffc7dad66a7f39832204da3f"
dependencies = [
"cranelift-assembler-x64-meta",
]
[[package]]
name = "cranelift-assembler-x64-meta"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97eeeb61b08ec484f274119faf3a8a1b80dd300b0208c0247d16d05982fc89fe"
+checksum = "5e3b92a9cc90388fe70e63640af30b734387449445aef0176ab2028e9892d70e"
dependencies = [
"cranelift-srcgen",
]
[[package]]
name = "cranelift-bforest"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "782eb44158681a105d157cb0ce63e3dc83f78ef5674266c12234f49da3f5c6e8"
+checksum = "f45c85646c4425cc85b868effaf20c302b437a3fb79bb27a64513dd522f07411"
dependencies = [
"cranelift-entity",
+ "wasmtime-internal-core",
]
[[package]]
name = "cranelift-bitset"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "edd59af193204c4f025fb2c2d9ee0aeb1f60929edf000b0dfa3d45543a62f264"
+checksum = "94f56b5c7d564cfa03aa269a6b98c916cab4d545196a391d31403a23ef39333a"
dependencies = [
"serde",
"serde_derive",
+ "wasmtime-internal-core",
]
[[package]]
name = "cranelift-codegen"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b1c29bd985057d790db25f6bc60b369b311aa2d75c2f496a7e9993585bfc7d60"
+checksum = "2c073641ce6e382814a8220331cc1ea2c782a9ea5d5da6d0f7f7c0541192693e"
dependencies = [
"bumpalo",
"cranelift-assembler-x64",
@@ -607,22 +629,26 @@ dependencies = [
"cranelift-entity",
"cranelift-isle",
"gimli",
- "hashbrown 0.15.5",
+ "hashbrown 0.17.1",
+ "libm",
"log",
+ "postcard",
"pulley-interpreter",
"regalloc2",
"rustc-hash 2.1.3",
"serde",
+ "serde_derive",
+ "sha2",
"smallvec",
"target-lexicon",
- "wasmtime-internal-math",
+ "wasmtime-internal-core",
]
[[package]]
name = "cranelift-codegen-meta"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9ef8a8495f19212f92db8425f768ffc67000c5cb417a0664475a8d09596700f"
+checksum = "db226fafea5194921de10dccf35ac2863500313990f770cbe8b26c51eebec4d4"
dependencies = [
"cranelift-assembler-x64-meta",
"cranelift-codegen-shared",
@@ -633,37 +659,39 @@ dependencies = [
[[package]]
name = "cranelift-codegen-shared"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3aa5099097666baf45bd68ef036327c8f29d8785fffaaa7db3b3b6b7e94bcc6"
+checksum = "cf8ac46b2c8e328ca979810426ea635ef90ecc8c54fd3296bde31ab470a48a1d"
[[package]]
name = "cranelift-control"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26f67f4f4e92c2934f40c2ff4574400bd27326932aad937a438b7fb459f60a63"
+checksum = "6754e0ab97915209ea6ce6549f6443b018e1338142ada4c856cec213ee82e4b8"
dependencies = [
"arbitrary",
]
[[package]]
name = "cranelift-entity"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8393d09f0abaa504896069e79f4eb6f15eb1853e5645732b082dac1ed292aaa8"
+checksum = "774d25e36df18696f63a284e9c4ea43455e2ebcca6308e0e02301f18c8e777e2"
dependencies = [
"cranelift-bitset",
"serde",
"serde_derive",
+ "wasmtime-internal-core",
]
[[package]]
name = "cranelift-frontend"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "580cfaecbd11476dd82f6a393123dcbd9dfe583467df8d0c8441c641444d4985"
+checksum = "69cfcb31405e2de2a48e5a6de8e07a3d8b77f35caa3e944d627780734b36c138"
dependencies = [
"cranelift-codegen",
+ "hashbrown 0.17.1",
"log",
"smallvec",
"target-lexicon",
@@ -671,15 +699,15 @@ dependencies = [
[[package]]
name = "cranelift-isle"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c044843adb7d94b1facebaad846c0a762f79a77953417e3f0182093bcbbdc38"
+checksum = "2f5a26df22db546ab92be6feaf21835ae91082af0a32bbb398b277df3765412f"
[[package]]
name = "cranelift-native"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9d4c1707214e53f2040e4d13430069ea22623287b2750ed6d62e40eba88d91a"
+checksum = "19f258c08e590f90dcaf9904d25ba142ee2980c3aaeac4bb45f1452b1a407c2a"
dependencies = [
"cranelift-codegen",
"libc",
@@ -688,9 +716,9 @@ dependencies = [
[[package]]
name = "cranelift-srcgen"
-version = "0.123.18"
+version = "0.135.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d355a35edc49f628db7b793f3527eed31b560e77c3e8ed0e5258aad8df8a5249"
+checksum = "67055b4f315e8f6af3e8eccec74ad38f7407f0fd854adbd49b4b3b27bdb2e3be"
[[package]]
name = "crc32fast"
@@ -895,12 +923,6 @@ version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b5343afd4a8365a643ac588dab4cf234a190c7f6c88c9f6dd6ffe00837661b7"
-[[package]]
-name = "fallible-iterator"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649"
-
[[package]]
name = "fdeflate"
version = "0.3.7"
@@ -993,12 +1015,48 @@ dependencies = [
"percent-encoding",
]
+[[package]]
+name = "futures"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-channel"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4"
+dependencies = [
+ "futures-core",
+ "futures-sink",
+]
+
[[package]]
name = "futures-core"
version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e"
+[[package]]
+name = "futures-io"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
+
+[[package]]
+name = "futures-sink"
+version = "0.3.34"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d"
+
[[package]]
name = "futures-task"
version = "0.3.34"
@@ -1011,8 +1069,12 @@ version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc"
dependencies = [
+ "futures-channel",
"futures-core",
+ "futures-io",
+ "futures-sink",
"futures-task",
+ "memchr",
"pin-project-lite",
"slab",
]
@@ -1107,11 +1169,12 @@ dependencies = [
[[package]]
name = "gimli"
-version = "0.32.3"
+version = "0.33.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e629b9b98ef3dd8afe6ca2bd0f89306cec16d43d907889945bc5d6687f2f13c7"
+checksum = "0bf7f043f89559805f8c7cacc432749b2fa0d0a0a9ee46ce47164ed5ba7f126c"
dependencies = [
- "fallible-iterator",
+ "fnv",
+ "hashbrown 0.16.1",
"indexmap",
"stable_deref_trait",
]
@@ -1187,7 +1250,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1"
dependencies = [
"foldhash 0.1.5",
- "serde",
]
[[package]]
@@ -1208,6 +1270,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
dependencies = [
"foldhash 0.2.0",
+ "serde",
+ "serde_core",
]
[[package]]
@@ -1358,7 +1422,7 @@ dependencies = [
name = "horizon-mod-sdk"
version = "0.1.0"
dependencies = [
- "wit-bindgen",
+ "wit-bindgen 0.60.0",
]
[[package]]
@@ -1372,8 +1436,8 @@ dependencies = [
"sha2",
"toml",
"wasmtime",
- "wit-component 0.239.0",
- "wit-parser 0.239.0",
+ "wit-component",
+ "wit-parser",
"zip",
]
@@ -1408,6 +1472,8 @@ dependencies = [
name = "horizon-prepare"
version = "0.1.0"
dependencies = [
+ "crc32fast",
+ "libc",
"regex",
"sha1",
"sha2",
@@ -1971,6 +2037,12 @@ dependencies = [
"libc",
]
+[[package]]
+name = "mach2"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dae608c151f68243f2b000364e1f7b186d9c29845f7d2d85bd31b9ad77ad552b"
+
[[package]]
name = "memchr"
version = "2.8.3"
@@ -2506,12 +2578,12 @@ dependencies = [
[[package]]
name = "object"
-version = "0.37.3"
+version = "0.39.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe"
+checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b"
dependencies = [
"crc32fast",
- "hashbrown 0.15.5",
+ "hashbrown 0.17.1",
"indexmap",
"memchr",
]
@@ -2733,6 +2805,13 @@ dependencies = [
"unicode-xid",
]
+[[package]]
+name = "predator-missile"
+version = "0.1.0"
+dependencies = [
+ "horizon-mod-sdk",
+]
+
[[package]]
name = "presser"
version = "0.3.1"
@@ -2775,21 +2854,21 @@ checksum = "3d595e54a326bc53c1c197b32d295e14b169e3cfeaa8dc82b529f947fba6bcf5"
[[package]]
name = "pulley-interpreter"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "334ae8982dcf354e5f28e79fc6f935601e028b729cc174d3937eeeaa859057b8"
+checksum = "2b8187c8e7db87d085865fc106502e7b34d5c25f8ce4c272945b21503371f6a0"
dependencies = [
"cranelift-bitset",
"log",
"pulley-macros",
- "wasmtime-internal-math",
+ "wasmtime-internal-core",
]
[[package]]
name = "pulley-macros"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9cd207bca4bc5e46cb4fcea87196dcbd78befc628c64c67d11dc99fce5cd5369"
+checksum = "7f98ce0e381d9e45e63ea1d20bba3cf131797086077f43af9203f1fb7de0ed6b"
dependencies = [
"proc-macro2",
"quote",
@@ -2888,15 +2967,16 @@ dependencies = [
[[package]]
name = "regalloc2"
-version = "0.12.2"
+version = "0.15.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5216b1837de2149f8bc8e6d5f88a9326b63b8c836ed58ce4a0a29ec736a59734"
+checksum = "757712e8e61590d6d4f5d563483755538b5aa13467837a3b41cd9832509a7f85"
dependencies = [
"allocator-api2",
"bumpalo",
- "hashbrown 0.15.5",
+ "hashbrown 0.17.1",
"log",
"rustc-hash 2.1.3",
+ "serde",
"smallvec",
]
@@ -2949,6 +3029,12 @@ dependencies = [
"windows-sys 0.52.0",
]
+[[package]]
+name = "rustc-demangle"
+version = "0.1.28"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b74b56ffa8bb2830709a538c2cbcae9aa062db0d2a42563bfb09bdaae44020eb"
+
[[package]]
name = "rustc-hash"
version = "1.1.0"
@@ -3732,7 +3818,7 @@ version = "1.0.4+wasi-0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487"
dependencies = [
- "wit-bindgen",
+ "wit-bindgen 0.57.1",
]
[[package]]
@@ -3793,124 +3879,66 @@ dependencies = [
[[package]]
name = "wasm-encoder"
-version = "0.236.1"
+version = "0.254.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "724fccfd4f3c24b7e589d333fc0429c68042897a7e8a5f8694f31792471841e7"
+checksum = "ebaca0b540bdb15d195ff34fb23074255948708b8916a11a339ba4513dc61906"
dependencies = [
"leb128fmt",
- "wasmparser 0.236.1",
-]
-
-[[package]]
-name = "wasm-encoder"
-version = "0.239.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5be00faa2b4950c76fe618c409d2c3ea5a3c9422013e079482d78544bb2d184c"
-dependencies = [
- "leb128fmt",
- "wasmparser 0.239.0",
-]
-
-[[package]]
-name = "wasm-encoder"
-version = "0.247.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "30b6733b8b91d010a6ac5b0fb237dc46a19650bc4c67db66857e2e787d437204"
-dependencies = [
- "leb128fmt",
- "wasmparser 0.247.0",
+ "wasmparser",
]
[[package]]
name = "wasm-metadata"
-version = "0.239.0"
+version = "0.254.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "20b3ec880a9ac69ccd92fbdbcf46ee833071cf09f82bb005b2327c7ae6025ae2"
+checksum = "5d1880dd9a848aa68f387966256c34ad49abb4607e3cfa35720d2723d0591cd3"
dependencies = [
"anyhow",
"indexmap",
- "wasm-encoder 0.239.0",
- "wasmparser 0.239.0",
-]
-
-[[package]]
-name = "wasm-metadata"
-version = "0.247.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "665fe59e56cc9b419ca6fcca56673e3421d1a5011e3b65caf6b726fd9e041d10"
-dependencies = [
- "anyhow",
- "indexmap",
- "wasm-encoder 0.247.0",
- "wasmparser 0.247.0",
+ "wasm-encoder",
+ "wasmparser",
]
[[package]]
name = "wasmparser"
-version = "0.236.1"
+version = "0.254.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9b1e81f3eb254cf7404a82cee6926a4a3ccc5aad80cc3d43608a070c67aa1d7"
+checksum = "c5ff8685b587722894b6f25958fc608d315b93b8d23647bfb567664e7006d757"
dependencies = [
"bitflags 2.13.2",
- "hashbrown 0.15.5",
+ "hashbrown 0.17.1",
"indexmap",
"semver",
"serde",
]
-[[package]]
-name = "wasmparser"
-version = "0.239.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8c9d90bb93e764f6beabf1d02028c70a2156a6583e63ac4218dd07ef733368b0"
-dependencies = [
- "bitflags 2.13.2",
- "hashbrown 0.15.5",
- "indexmap",
- "semver",
-]
-
-[[package]]
-name = "wasmparser"
-version = "0.247.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e6fb4c2bee46c5ea4d40f8cdb5c131725cd976718ec56f1c8e82fbde5fa2a80"
-dependencies = [
- "bitflags 2.13.2",
- "hashbrown 0.17.1",
- "indexmap",
- "semver",
-]
-
[[package]]
name = "wasmprinter"
-version = "0.236.1"
+version = "0.254.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2df225df06a6df15b46e3f73ca066ff92c2e023670969f7d50ce7d5e695abbb1"
+checksum = "8b03c8f270f3f384f70f42869b5ff7f6253fe4f0aa8590f7edd332c1943e5f51"
dependencies = [
"anyhow",
"termcolor",
- "wasmparser 0.236.1",
+ "wasmparser",
]
[[package]]
name = "wasmtime"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70095b9fe63cc2a87ed206729e11544610decc184c62898c5d201ff1d666d82e"
+checksum = "12300d040e8bea7e7ccde75b9919d27ebba47a217a64b09ba058ae8d3b4290b6"
dependencies = [
"addr2line",
- "anyhow",
+ "async-trait",
"bitflags 2.13.2",
"bumpalo",
"cc",
- "cfg-if",
"encoding_rs",
- "hashbrown 0.15.5",
- "indexmap",
+ "futures",
"libc",
"log",
- "mach2",
+ "mach2 0.6.0",
"memfd",
"object",
"once_cell",
@@ -3922,62 +3950,56 @@ dependencies = [
"serde_derive",
"smallvec",
"target-lexicon",
- "wasmparser 0.236.1",
+ "wasmparser",
"wasmtime-environ",
- "wasmtime-internal-asm-macros",
"wasmtime-internal-component-macro",
"wasmtime-internal-component-util",
+ "wasmtime-internal-core",
"wasmtime-internal-cranelift",
"wasmtime-internal-fiber",
"wasmtime-internal-jit-debug",
"wasmtime-internal-jit-icache-coherence",
- "wasmtime-internal-math",
- "wasmtime-internal-slab",
"wasmtime-internal-unwinder",
"wasmtime-internal-versioned-export-macros",
- "wasmtime-internal-winch",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
name = "wasmtime-environ"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a67ea8904b6e369e2218780bd1f9186f1980cb616445eb2c1f3c4e45c8397865"
+checksum = "805d6554eb6dd6e62891061a31383a89d69fd891f785e5ae68f0835a554b7a2a"
dependencies = [
"anyhow",
+ "cpp_demangle",
+ "cranelift-bforest",
"cranelift-bitset",
"cranelift-entity",
"gimli",
+ "hashbrown 0.17.1",
"indexmap",
"log",
"object",
"postcard",
+ "rustc-demangle",
"semver",
"serde",
"serde_derive",
+ "sha2",
"smallvec",
"target-lexicon",
- "wasm-encoder 0.236.1",
- "wasmparser 0.236.1",
+ "wasm-encoder",
+ "wasmparser",
"wasmprinter",
"wasmtime-internal-component-util",
-]
-
-[[package]]
-name = "wasmtime-internal-asm-macros"
-version = "36.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0488a52ae93e654baecb08ce04d15d478756eb2168c2bdab7915710109161ce"
-dependencies = [
- "cfg-if",
+ "wasmtime-internal-core",
]
[[package]]
name = "wasmtime-internal-component-macro"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "377e406c3f8e7bea64db3cb3ee0d406c331e8fc09d8cb2e7bf9ad74cb5d3b31a"
+checksum = "b832b80853365d9d3a741681044554be291a4f977aae074b318b55c7a4835f83"
dependencies = [
"anyhow",
"proc-macro2",
@@ -3985,23 +4007,32 @@ dependencies = [
"syn 2.0.119",
"wasmtime-internal-component-util",
"wasmtime-internal-wit-bindgen",
- "wit-parser 0.236.1",
+ "wit-parser",
]
[[package]]
name = "wasmtime-internal-component-util"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97c24503bb712afe2c797dc291b96e57556ee62c35fd951f87e96088324de37c"
+checksum = "4c8a11aaf68d8945991429d45950f32490a30ddcdcdb56629816cb41a255d8fe"
+
+[[package]]
+name = "wasmtime-internal-core"
+version = "48.0.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ea266d6cfb31c324c075c8432386654bcbb1559aa8d29be9d47eacf7dcc41012"
+dependencies = [
+ "hashbrown 0.17.1",
+ "libm",
+ "serde",
+]
[[package]]
name = "wasmtime-internal-cranelift"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f63ea7ee133de9109a4a1fc63dae3afc9ea32e92b8dada824fa4595dbf175f80"
+checksum = "d427759553b07c296c8ed7bff8ac930a94b9ba99e6a79243ea79bcc51aa58d96"
dependencies = [
- "anyhow",
- "cfg-if",
"cranelift-codegen",
"cranelift-control",
"cranelift-entity",
@@ -4015,33 +4046,32 @@ dependencies = [
"smallvec",
"target-lexicon",
"thiserror 2.0.21",
- "wasmparser 0.236.1",
+ "wasmparser",
"wasmtime-environ",
- "wasmtime-internal-math",
+ "wasmtime-internal-core",
+ "wasmtime-internal-unwinder",
"wasmtime-internal-versioned-export-macros",
]
[[package]]
name = "wasmtime-internal-fiber"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69662a0a4dbe9784d1e8add9e3c5d2db0ca348085c624c27a70992dbe2eff4a3"
+checksum = "b54c8c5b02ea985149a90f917e1761af99734c6c27e6d7fdd5b6f69fc1db3950"
dependencies = [
- "anyhow",
"cc",
- "cfg-if",
"libc",
"rustix 1.1.5",
- "wasmtime-internal-asm-macros",
+ "wasmtime-environ",
"wasmtime-internal-versioned-export-macros",
- "windows-sys 0.60.2",
+ "windows-sys 0.61.2",
]
[[package]]
name = "wasmtime-internal-jit-debug"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00cb07d23903c0be359d6b920d94774ea322759c3f4d6721b61afa03602e4804"
+checksum = "72bb10c94724f072b6eca515085033e61da9efae65d054545126df37a15530c3"
dependencies = [
"cc",
"wasmtime-internal-versioned-export-macros",
@@ -4049,83 +4079,50 @@ dependencies = [
[[package]]
name = "wasmtime-internal-jit-icache-coherence"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa2b47c37a6d026e2755fe2cf7ec5c1f4b0fba62e448ea910cdf6a07a4982c6a"
+checksum = "1b781a27e8958fd07fd3135c0be216f77301efecd15cbf4f14ff210cdad5f169"
dependencies = [
- "anyhow",
- "cfg-if",
"libc",
- "windows-sys 0.60.2",
+ "wasmtime-internal-core",
+ "windows-sys 0.61.2",
]
-[[package]]
-name = "wasmtime-internal-math"
-version = "36.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b269f0ba44102c57fd5f94f1bf4395ccd4fc2b84698fc78f627a6f2a47131a62"
-dependencies = [
- "libm",
-]
-
-[[package]]
-name = "wasmtime-internal-slab"
-version = "36.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e35ac9d503d503703cd24d532e53e2e93c86109b451df40a9801500045aee25"
-
[[package]]
name = "wasmtime-internal-unwinder"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83ce1d0930da44ed375701e6b4f187b46249f7efe2b1d8c1c77229a4adc82de9"
+checksum = "121188de1b2741b8e35530a9b0c8adf525b3aa5913a2ca3d4522509cfbc0494a"
dependencies = [
- "anyhow",
- "cfg-if",
"cranelift-codegen",
"log",
"object",
+ "wasmtime-environ",
]
[[package]]
name = "wasmtime-internal-versioned-export-macros"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3b6633be262400bd7abab4ff767a16e8b6a41ff117be54bf76dabecea9f96225"
+checksum = "933f1990e4e5177547a4abd51dcfa5cb7616fe42b9fb6f0f2b7423627758223c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.119",
]
-[[package]]
-name = "wasmtime-internal-winch"
-version = "36.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "509d1e1cf8e3b3306f291407c92bca8381d9294f8c54ad74b692538f1f5b23c7"
-dependencies = [
- "anyhow",
- "cranelift-codegen",
- "gimli",
- "object",
- "target-lexicon",
- "wasmparser 0.236.1",
- "wasmtime-environ",
- "wasmtime-internal-cranelift",
- "winch-codegen",
-]
-
[[package]]
name = "wasmtime-internal-wit-bindgen"
-version = "36.0.18"
+version = "48.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6d9a5b51b3400b4df1055724c4536ad5aa58fafe83cea5ca94f88cc9eb97563"
+checksum = "417ebd61d2581d86d65413517f3a41294a9ad105da26f0dc7039912a0d97e1ed"
dependencies = [
"anyhow",
"bitflags 2.13.2",
"heck",
"indexmap",
- "wit-parser 0.236.1",
+ "wit-component",
+ "wit-parser",
]
[[package]]
@@ -4461,26 +4458,6 @@ dependencies = [
"windows-sys 0.61.2",
]
-[[package]]
-name = "winch-codegen"
-version = "36.0.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e470d7e674c41ad32dddc02d8d8a94983e0a4c516028bda60747e6dd862a567"
-dependencies = [
- "anyhow",
- "cranelift-assembler-x64",
- "cranelift-codegen",
- "gimli",
- "regalloc2",
- "smallvec",
- "target-lexicon",
- "thiserror 2.0.21",
- "wasmparser 0.236.1",
- "wasmtime-environ",
- "wasmtime-internal-cranelift",
- "wasmtime-internal-math",
-]
-
[[package]]
name = "windows"
version = "0.54.0"
@@ -4938,42 +4915,48 @@ name = "wit-bindgen"
version = "0.57.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e"
+
+[[package]]
+name = "wit-bindgen"
+version = "0.60.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a301904d6657d6364c758d869e5389d05d393b16d5b65db60b4f03cbe71bb80d"
dependencies = [
"wit-bindgen-rust-macro",
]
[[package]]
name = "wit-bindgen-core"
-version = "0.57.1"
+version = "0.60.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02dee27a2dc20d1008016c742ec9fc6ea498492994ba3750be7454cbc97ff04c"
+checksum = "48521bb96e56cbb9e031ad306c80dc20e89e69e49ada02781ee06f60fbcb545f"
dependencies = [
"anyhow",
"heck",
- "wit-parser 0.247.0",
+ "wit-parser",
]
[[package]]
name = "wit-bindgen-rust"
-version = "0.57.1"
+version = "0.60.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5007dae772945b7a5003d69d90a3a4a78929d41f19d004e980c4259a6af4484"
+checksum = "3df3fe9b9a0066f82fd0c2f07f79d0ffc0f85c53fa5f998516d8722712479042"
dependencies = [
"anyhow",
"heck",
"indexmap",
"prettyplease",
"syn 2.0.119",
- "wasm-metadata 0.247.0",
+ "wasm-metadata",
"wit-bindgen-core",
- "wit-component 0.247.0",
+ "wit-component",
]
[[package]]
name = "wit-bindgen-rust-macro"
-version = "0.57.1"
+version = "0.60.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "af9237d678e3513ad24e96fe98beacdc0db6405284ba2a2400418cf0d42caa89"
+checksum = "d689c4bc9d6af067c651cfba444766343c9a4bdef15fad1e2efab95c0c277af0"
dependencies = [
"anyhow",
"prettyplease",
@@ -4986,9 +4969,9 @@ dependencies = [
[[package]]
name = "wit-component"
-version = "0.239.0"
+version = "0.254.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "88a866b19dba2c94d706ec58c92a4c62ab63e482b4c935d2a085ac94caecb136"
+checksum = "1c96b3cea6838dbea55173baa56991fcb087896c321b0a770db201e5a0bd3506"
dependencies = [
"anyhow",
"bitflags 2.13.2",
@@ -4997,72 +4980,17 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
- "wasm-encoder 0.239.0",
- "wasm-metadata 0.239.0",
- "wasmparser 0.239.0",
- "wit-parser 0.239.0",
-]
-
-[[package]]
-name = "wit-component"
-version = "0.247.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d567162a6b9843080e5e0053f696623ff694bae8ae017c9ec536d1873bbe3d8"
-dependencies = [
- "anyhow",
- "bitflags 2.13.2",
- "indexmap",
- "log",
- "serde",
- "serde_derive",
- "serde_json",
- "wasm-encoder 0.247.0",
- "wasm-metadata 0.247.0",
- "wasmparser 0.247.0",
- "wit-parser 0.247.0",
+ "wasm-encoder",
+ "wasm-metadata",
+ "wasmparser",
+ "wit-parser",
]
[[package]]
name = "wit-parser"
-version = "0.236.1"
+version = "0.254.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16e4833a20cd6e85d6abfea0e63a399472d6f88c6262957c17f546879a80ba15"
-dependencies = [
- "anyhow",
- "id-arena",
- "indexmap",
- "log",
- "semver",
- "serde",
- "serde_derive",
- "serde_json",
- "unicode-xid",
- "wasmparser 0.236.1",
-]
-
-[[package]]
-name = "wit-parser"
-version = "0.239.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55c92c939d667b7bf0c6bf2d1f67196529758f99a2a45a3355cc56964fd5315d"
-dependencies = [
- "anyhow",
- "id-arena",
- "indexmap",
- "log",
- "semver",
- "serde",
- "serde_derive",
- "serde_json",
- "unicode-xid",
- "wasmparser 0.239.0",
-]
-
-[[package]]
-name = "wit-parser"
-version = "0.247.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ffe4064318cdf3c08cb99343b44c039fcefe61ccdf58aa9975285f13d74d1fc"
+checksum = "22672d61bfb9df46a16b46ce38522293aee1cc4749fc84a3464ce4083b3d5fd6"
dependencies = [
"anyhow",
"hashbrown 0.17.1",
@@ -5073,8 +5001,8 @@ dependencies = [
"serde",
"serde_derive",
"serde_json",
- "unicode-xid",
- "wasmparser 0.247.0",
+ "unicode-ident",
+ "wasmparser",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 4076b9079..fff062e3a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[workspace]
exclude = ["launcher", "crates/horizon-telemetry-server", "crates/horizon-mod-registry", "third_party/wgpu-hal"]
-members = ["crates/horizon-core", "crates/horizon-dualsense", "crates/horizon-threads", "crates/horizon-world", "crates/horizon-client", "crates/horizon-server-files", "crates/horizon-server", "crates/horizon-bots", "crates/horizon-assets", "crates/horizon-protocol", "crates/horizon-theme", "crates/horizon-prepare", "crates/horizon-telemetry", "crates/horizon-bench", "crates/horizon-friends", "crates/horizon-relay", "crates/horizon-mod-sdk", "crates/horizon-mods", "crates/horizon-mods/tests/guest", "crates/horizon-mods/tests/ui_guest", "crates/cargo-horizon-mod", "crates/horizon-port-pack", "crates/horizon-shaders", "crates/horizon-shader-api", "crates/horizon-release-sign", "crates/horizon-mod-sdk/examples/coords-hud", "xtask"]
+members = ["crates/horizon-core", "crates/horizon-dualsense", "crates/horizon-threads", "crates/horizon-world", "crates/horizon-client", "crates/horizon-server-files", "crates/horizon-server", "crates/horizon-bots", "crates/horizon-assets", "crates/horizon-protocol", "crates/horizon-theme", "crates/horizon-prepare", "crates/horizon-telemetry", "crates/horizon-bench", "crates/horizon-friends", "crates/horizon-relay", "crates/horizon-mod-sdk", "crates/horizon-mods", "crates/horizon-mods/tests/guest", "crates/horizon-mods/tests/ui_guest", "crates/cargo-horizon-mod", "crates/horizon-port-pack", "crates/horizon-shaders", "crates/horizon-shader-api", "crates/horizon-release-sign", "crates/horizon-mod-sdk/examples/coords-hud", "crates/horizon-mod-sdk/examples/predator-missile", "xtask"]
resolver = "2"
[workspace.package]
diff --git a/README.md b/README.md
index ceee29249..65078464e 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Horizon is Minecraft: Java Edition 26.3 rewritten in Rust: a native game that re
Horizon is installed through **the Horizon launcher**. Get it from [playhorizon.dev](https://playhorizon.dev) (the Download button picks your system) or from [the launcher releases](https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true), for Linux x86-64, macOS on Apple Silicon or Windows x64. The launcher installs and updates the game, prepares its files from your own copy of Minecraft, and updates itself.
-**You need** Minecraft: Java Edition 26.3, played once (the official launcher, Prism, MultiMC and other launchers all work); a Java 25 JDK, for the one-time preparation; and a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac. Step by step, with macOS's first-open prompt and the first launch: [Install and first launch](https://playhorizon.dev/docs/install).
+**You need** Minecraft: Java Edition 26.3, played once (the official launcher, Prism, MultiMC and other launchers all work); a Java 25 runtime, for the one-time preparation; and a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac. Step by step, with macOS's first-open prompt and the first launch: [Install and first launch](https://playhorizon.dev/docs/install).
diff --git a/crates/cargo-horizon-mod/src/check.rs b/crates/cargo-horizon-mod/src/check.rs
index 8e1b2bc9b..a10d27804 100644
--- a/crates/cargo-horizon-mod/src/check.rs
+++ b/crates/cargo-horizon-mod/src/check.rs
@@ -208,6 +208,9 @@ fn play(path: &Path, report: &mut Report) -> Result<(), String> {
game_time: t,
day_time: 1000 + t,
}),
+ // The GUI of a 1280 x 720 window at scale 3.
+ gui_size: (427.0, 240.0),
+ held: None,
});
mods.tick(t);
for _ in 0..FRAMES_PER_TICK {
@@ -224,11 +227,19 @@ fn play(path: &Path, report: &mut Report) -> Result<(), String> {
Output::Feedback { text, error } => {
format!("{}: {text}", if error { "error" } else { "feedback" })
}
+ Output::Command { line } => format!("command: /{line}"),
Output::Stopped { reason, .. } => return Err(format!("it stopped: {reason}")),
Output::OpenScreen { .. } => "opened a screen".to_string(),
Output::CloseScreen { .. } => "closed its screen".to_string(),
+ Output::Shake { strength, seconds } => {
+ format!("shook the camera: {strength:.2} for {seconds:.1} s")
+ }
});
}
+ let shapes = mods.hud_shapes().count();
+ if shapes > 0 {
+ report.output.push(format!("drew {shapes} HUD shape(s)"));
+ }
match failed(&mods) {
Some(reason) => Err(format!("it stopped: {reason}")),
None => Ok(()),
diff --git a/crates/horizon-client/examples/probe/block_entity_render_fixture.rs b/crates/horizon-client/examples/probe/block_entity_render_fixture.rs
index a0e3471bc..1db978b77 100644
--- a/crates/horizon-client/examples/probe/block_entity_render_fixture.rs
+++ b/crates/horizon-client/examples/probe/block_entity_render_fixture.rs
@@ -367,6 +367,7 @@ pub fn main() -> Result<()> {
lid: &|_| open,
sign: &|_| sign.as_ref(),
banner: &|_| layers.clone(),
+ skull: &|_| None,
glyph: &|c| atlas.glyph_cell(c),
};
let mut verts = Vec::new();
diff --git a/crates/horizon-client/examples/probe/mob_ai_probe.rs b/crates/horizon-client/examples/probe/mob_ai_probe.rs
index 157baa74c..49f56c250 100644
--- a/crates/horizon-client/examples/probe/mob_ai_probe.rs
+++ b/crates/horizon-client/examples/probe/mob_ai_probe.rs
@@ -598,6 +598,7 @@ fn print(out: &mut String, t: i32, i: usize, m: &Mob, player_down: bool, now: i6
let _ = writeln!(out, " removed {reason}");
return;
}
+ let _ = write!(out, "\tleashed {}", u8::from(m.extra.leash.is_some()));
let p = m.position;
let v = m.velocity;
let _ = write!(
@@ -977,6 +978,7 @@ pub fn main() -> horizon_client::Result<()> {
}
// Set once the brain exists (below).
x if x.starts_with("cooldown=") => {}
+ "dead" => m.health = 0.0,
"leashed" => m.extra.leash = Some(horizon_client::mobs::leash::Holder::Player),
x if x.starts_with("leashto=") => {
let n: u32 = x[8..].parse().unwrap();
@@ -1097,6 +1099,7 @@ pub fn main() -> horizon_client::Result<()> {
}
};
}
+ let mut dropped_leads = 0;
for t in 1..=s.ticks {
world.game_time += 1;
if s.daycycle {
@@ -1208,6 +1211,16 @@ pub fn main() -> horizon_client::Result<()> {
if !alive {
m.removed = true;
}
+ // Apply the same detach/drop event as Game::break_leash.
+ for event in &events[from..] {
+ if let MobEvent::LeashBreak { mob, drop, .. } = event
+ && let Some(m) = mobs.iter_mut().find(|m| m.id == *mob)
+ && horizon_client::mobs::leash::remove(m).is_some()
+ && *drop
+ {
+ dropped_leads += 1;
+ }
+ }
horizon_client::mobs::apply_brain_events(&mut mobs, &mut events, from);
villager_events(
&mut mobs,
@@ -1427,6 +1440,9 @@ pub fn main() -> horizon_client::Result<()> {
world.game_time,
);
}
+ if s.name.starts_with("leash_death_") {
+ let _ = writeln!(out, "{t} leads {dropped_leads}");
+ }
for e in &events {
if let MobEvent::Sound(name, _, volume, pitch) = e {
let _ = writeln!(
diff --git a/crates/horizon-client/src/animate_tick.rs b/crates/horizon-client/src/animate_tick.rs
index ce34df510..48e8f16f4 100644
--- a/crates/horizon-client/src/animate_tick.rs
+++ b/crates/horizon-client/src/animate_tick.rs
@@ -63,6 +63,10 @@ enum Animate {
SculkSensor,
/// Potent sulfur that is not dry.
PotentSulfur,
+ DriedGhast {
+ waterlogged: bool,
+ },
+ EndPortal,
}
fn step(facing: &str) -> [i32; 3] {
match facing {
@@ -137,6 +141,10 @@ fn classify(name: &str, prop: &dyn Fn(&str) -> Option) -> Animate {
drag: prop("drag").as_deref() == Some("true"),
},
"fire" | "soul_fire" => Animate::Fire,
+ "dried_ghast" => Animate::DriedGhast {
+ waterlogged: prop("waterlogged").as_deref() == Some("true"),
+ },
+ "end_portal" => Animate::EndPortal,
"sculk_sensor" | "calibrated_sculk_sensor"
if prop("sculk_sensor_phase").as_deref() == Some("active") =>
{
@@ -180,6 +188,8 @@ pub struct AnimateTables {
impermeable: Vec,
power_provider: Vec,
power_transmitter: Vec,
+ /// `#triggers_ambient_dried_ghast_block_sounds` (soul sand, soul soil).
+ dried_ghast_sounds: Vec,
/// Biome id -> ambient particles and probabilities (`minecraft:visual/ambient_particles`).
ambient: Vec>,
}
@@ -237,6 +247,7 @@ impl AnimateTables {
impermeable: by_state("minecraft:impermeable"),
power_provider: by_state("minecraft:enchantment_power_provider"),
power_transmitter: by_state("minecraft:enchantment_power_transmitter"),
+ dried_ghast_sounds: by_state("minecraft:triggers_ambient_dried_ghast_block_sounds"),
ambient,
})
}
@@ -869,6 +880,45 @@ fn block_animate_tick(
];
add(engine, T::Smoke, p, [0.0; 3]);
}
+ Animate::DriedGhast { waterlogged } => {
+ // DriedGhastBlock.animateTick.
+ let c = [fx + 0.5, fy + 0.5, fz + 0.5];
+ if waterlogged {
+ if next_int(engine.random(), 40) == 0 {
+ let name = "minecraft:block.dried_ghast.ambient_water";
+ sound(engine, name, c, 1.0, 1.0);
+ }
+ let r = engine.random();
+ if next_int(r, 6) == 0 {
+ let x = c[0] + f64::from((r.next_float() * 2.0 - 1.0) / 3.0);
+ let y = c[1] + 0.4;
+ let z = c[2] + f64::from((r.next_float() * 2.0 - 1.0) / 3.0);
+ let v = [0.0, f64::from(r.next_float()), 0.0];
+ add(engine, T::HappyVillager, [x, y, z], v);
+ }
+ } else {
+ let below = ctx.state([pos[0], pos[1] - 1, pos[2]]);
+ let triggers = || {
+ tables
+ .dried_ghast_sounds
+ .get(below.0 as usize)
+ .copied()
+ .unwrap_or(false)
+ };
+ if next_int(engine.random(), 40) == 0 && triggers() {
+ sound(engine, "minecraft:block.dried_ghast.ambient", c, 1.0, 1.0);
+ }
+ if next_int(engine.random(), 6) == 0 {
+ add(engine, T::WhiteSmoke, c, [0.0, 0.02, 0.0]);
+ }
+ }
+ }
+ Animate::EndPortal => {
+ // EndPortalBlock.animateTick: one smoke particle above the surface.
+ let r = engine.random();
+ let p = [fx + r.next_double(), fy + 0.8, fz + r.next_double()];
+ add(engine, T::Smoke, p, [0.0; 3]);
+ }
Animate::EnderChest => {
for _ in 0..3 {
let r = engine.random();
diff --git a/crates/horizon-client/src/block_entity_render.rs b/crates/horizon-client/src/block_entity_render.rs
index af4168307..10c5e2509 100644
--- a/crates/horizon-client/src/block_entity_render.rs
+++ b/crates/horizon-client/src/block_entity_render.rs
@@ -730,6 +730,10 @@ pub struct Scene<'a> {
pub sign: &'a dyn Fn([i32; 3]) -> Option<&'a crate::signs::SignData>,
/// Banner layers at a position: pattern texture and RGB tint, bottom first.
pub banner: &'a dyn Fn([i32; 3]) -> Vec<(String, u32)>,
+ /// The skin sprite a `player_head` shows at a position (`SkullBlockRenderer`
+ /// profile → skin): a downloaded `skins/` slot or the profile's
+ /// `DefaultPlayerSkin` fallback; None keeps `SKIN_BY_TYPE` (`DefaultPlayerSkin.getDefaultTexture`, slim steve).
+ pub skull: &'a dyn Fn([i32; 3]) -> Option<&'a str>,
/// Font glyph cell (none for blank glyphs such as the space) and advance.
pub glyph: &'a dyn Fn(char) -> (Option, f32),
}
@@ -1279,6 +1283,13 @@ impl BlockEntityRenderer {
SkullType::Piglin => ("piglin_head", "entity/piglin/piglin"),
SkullType::Player => ("player_head", "entity/player/slim/steve"),
};
+ // SkullBlockRenderer.getRenderType: the profile's skin when it
+ // resolves, `SKIN_BY_TYPE` (steve) otherwise.
+ let texture = if *kind == SkullType::Player {
+ (scene.skull)(pos).unwrap_or(texture)
+ } else {
+ texture
+ };
let (Some(model), Some(paint)) =
(self.models.get(model), paint(texture, 0xFFFFFF, packed))
else {
@@ -1886,6 +1897,7 @@ mod tests {
lid: &|_| 0.0,
sign: &|_| None,
banner: &|_| Vec::new(),
+ skull: &|_| None,
glyph: &|_| (None, 0.0),
};
// Compare the cached world path with the original model renderer,
diff --git a/crates/horizon-client/src/command/tests.rs b/crates/horizon-client/src/command/tests.rs
index 2bdea1aba..d61fd8ae1 100644
--- a/crates/horizon-client/src/command/tests.rs
+++ b/crates/horizon-client/src/command/tests.rs
@@ -592,3 +592,21 @@ fn mod_commands_join_the_tree_for_every_player() {
// The game's own tree is left as it was.
assert!(vanilla::game_dispatcher().find("where").is_none());
}
+
+#[test]
+fn horizon_commands_are_off_unless_the_server_turns_them_on() {
+ // By default the game runs vanilla's tree: /help lists no /pregen.
+ assert!(vanilla::game_dispatcher().find("pregen").is_none());
+ for dev in [false, true] {
+ let vanilla_tree = vanilla::game_tree(dev, false);
+ assert!(vanilla_tree.find("pregen").is_none());
+ let d = vanilla::game_tree(dev, true);
+ let parse = d.parse("pregen start 100 circle", ®());
+ assert_eq!(parse.executable().unwrap().1, "pregen.start");
+ // Vanilla's commands are the same with or without it.
+ assert_eq!(
+ d.nodes[0].children.len(),
+ vanilla_tree.nodes[0].children.len() + 1
+ );
+ }
+}
diff --git a/crates/horizon-client/src/command/vanilla.rs b/crates/horizon-client/src/command/vanilla.rs
index cdd4848d7..2ce892077 100644
--- a/crates/horizon-client/src/command/vanilla.rs
+++ b/crates/horizon-client/src/command/vanilla.rs
@@ -538,12 +538,69 @@ fn apply_vanilla_order(d: &mut Dispatcher) {
}
/// The tree the game runs: a release integrated server's, or with
/// `HORIZON_DEV_COMMANDS` set the development one
-/// (SharedConstants.DEBUG_DEV_COMMANDS).
+/// (SharedConstants.DEBUG_DEV_COMMANDS), plus Horizon's own commands when
+/// the server turned them on (`set_horizon_commands`).
pub fn game_dispatcher() -> &'static Dispatcher {
- if std::env::var_os("HORIZON_DEV_COMMANDS").is_some() {
- dispatcher()
- } else {
- release_dispatcher()
+ game_tree(
+ std::env::var_os("HORIZON_DEV_COMMANDS").is_some(),
+ HORIZON_COMMANDS.load(std::sync::atomic::Ordering::Relaxed),
+ )
+}
+/// Whether this process's server has Horizon's own commands (`/pregen`). Off
+/// by default, so `/help` and the command tree are vanilla's; a dedicated
+/// server turns them on with `horizon-pregen=true` in server.properties, the
+/// game with `--pregen` (docs/pregeneration.md).
+static HORIZON_COMMANDS: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);
+/// Turns Horizon's own commands on or off for the trees `game_dispatcher`
+/// returns from now on.
+pub fn set_horizon_commands(on: bool) {
+ HORIZON_COMMANDS.store(on, std::sync::atomic::Ordering::Relaxed);
+}
+/// The server.properties key that turns `/pregen` on (Horizon's own; vanilla
+/// ignores keys it doesn't know).
+pub const PREGEN_PROPERTY: &str = "horizon-pregen";
+pub(crate) fn game_tree(dev: bool, horizon: bool) -> &'static Dispatcher {
+ static HORIZON: [std::sync::OnceLock; 2] =
+ [const { std::sync::OnceLock::new() }; 2];
+ match (dev, horizon) {
+ (true, false) => dispatcher(),
+ (false, false) => release_dispatcher(),
+ (dev, true) => HORIZON[usize::from(dev)].get_or_init(|| {
+ let mut d = build_with(dev);
+ horizon_commands(&mut d, 0);
+ d
+ }),
+ }
+}
+/// Commands vanilla doesn't have, after its own: `/pregen`
+/// (docs/pregeneration.md).
+fn horizon_commands(d: &mut Dispatcher, root: usize) {
+ let pregen = d.literal(root, "pregen");
+ d.requires(pregen, GAMEMASTERS);
+ let start = d.literal(pregen, "start");
+ let radius = d.argument(
+ start,
+ "radius",
+ ArgType::Integer {
+ min: 0,
+ max: 30_000_000,
+ },
+ );
+ d.executes(radius, "pregen.start");
+ for shape in ["square", "circle"] {
+ let shape = d.literal(radius, shape);
+ d.executes(shape, "pregen.start");
+ let center = d.argument(shape, "center", ArgType::ColumnPos);
+ d.executes(center, "pregen.start");
+ }
+ for (word, id) in [
+ ("pause", "pregen.pause"),
+ ("continue", "pregen.continue"),
+ ("cancel", "pregen.cancel"),
+ ("status", "pregen.status"),
+ ] {
+ let w = d.literal(pregen, word);
+ d.executes(w, id);
}
}
pub fn dispatcher() -> &'static Dispatcher {
diff --git a/crates/horizon-client/src/containers.rs b/crates/horizon-client/src/containers.rs
index 26ca193a2..d13c5e45b 100644
--- a/crates/horizon-client/src/containers.rs
+++ b/crates/horizon-client/src/containers.rs
@@ -83,6 +83,60 @@ pub enum BlockEntity {
Beehive(Box),
/// `CommandBlockEntity` of the three command blocks (`crate::command_block`).
CommandBlock(Box),
+ /// `SkullBlockEntity` of every skull and head block.
+ Skull(Skull),
+}
+/// `SkullBlockEntity`: the player profile the head shows (kept as loaded:
+/// a compound, or a string when it names a player only), the note block
+/// sound and `custom_name`.
+#[derive(Clone, Debug, Default)]
+pub struct Skull {
+ pub profile: Option,
+ pub note_block_sound: Option,
+ pub custom_name: Option,
+ /// What `profile` draws, read from it once rather than every frame.
+ pub skin: Option,
+}
+impl Skull {
+ pub fn new(
+ profile: Option,
+ note_block_sound: Option,
+ custom_name: Option,
+ ) -> Self {
+ let skin = profile.as_ref().map(SkullSkin::of);
+ Self {
+ profile,
+ note_block_sound,
+ custom_name,
+ skin,
+ }
+ }
+}
+/// `SkullBlockRenderer.getPlayerSkin` of a head's profile: its skin's URL
+/// with the `skins/` sprite it downloads to, and the
+/// `DefaultPlayerSkin` drawn until that sprite is there (steve for a
+/// profile with no id).
+#[derive(Clone, Debug)]
+pub struct SkullSkin {
+ pub download: Option<(String, String)>,
+ pub fallback: &'static str,
+}
+impl SkullSkin {
+ pub fn of(profile: &horizon_world::nbt::Tag) -> Self {
+ let download = crate::skins::profile_skin_url_nbt(profile).and_then(|url| {
+ let location = crate::skins::skin_location(&crate::skins::texture_hash(&url)?);
+ Some((url, location))
+ });
+ // DefaultPlayerSkin.get(id), or getDefaultSkin (slim steve) without an id.
+ let fallback = crate::skins::profile_uuid_nbt(profile)
+ .map_or("entity/player/slim/steve", crate::tab_list::default_skin);
+ Self { download, fallback }
+ }
+}
+/// The skull and head blocks (`SkullBlock`, `WallSkullBlock`): every
+/// `*_skull` and `*_head` but the piston's head.
+fn is_skull(name: &str) -> bool {
+ name.ends_with("_skull") || (name.ends_with("_head") && name != "minecraft:piston_head")
}
/// `CrafterBlockEntity`: nine slots that can be disabled, the powered flag
/// and the ticks left in the crafting animation.
@@ -238,6 +292,9 @@ impl BlockEntity {
if name.ends_with("_banner") {
return Some(Self::Banner(Banner::default()));
}
+ if is_skull(name) {
+ return Some(Self::Skull(Skull::default()));
+ }
if name == "minecraft:beacon" {
return Some(Self::Beacon(Box::new(Beacon {
last_check_y: i32::MIN / 2,
@@ -283,6 +340,7 @@ impl BlockEntity {
Self::Vault(_) => "minecraft:vault",
Self::Beehive(_) => "minecraft:beehive",
Self::CommandBlock(_) => "minecraft:command_block",
+ Self::Skull(_) => "minecraft:skull",
}
}
pub fn contents(&self) -> Vec {
@@ -298,7 +356,8 @@ impl BlockEntity {
| Self::TrialSpawner(_)
| Self::Vault(_)
| Self::Beehive(_)
- | Self::CommandBlock(_) => Vec::new(),
+ | Self::CommandBlock(_)
+ | Self::Skull(_) => Vec::new(),
Self::Lectern(l) => l.book.iter().cloned().collect(),
Self::Sculk(_) => Vec::new(),
Self::Banner(_) => Vec::new(),
@@ -315,7 +374,8 @@ impl BlockEntity {
| Self::Beacon(_)
| Self::Lectern(_)
| Self::Sculk(_)
- | Self::Banner(_) => &[],
+ | Self::Banner(_)
+ | Self::Skull(_) => &[],
Self::Crafter(c) => &c.items,
Self::CreakingHeart(_)
| Self::Spawner(_)
@@ -335,7 +395,8 @@ impl BlockEntity {
| Self::Beacon(_)
| Self::Lectern(_)
| Self::Sculk(_)
- | Self::Banner(_) => &mut [],
+ | Self::Banner(_)
+ | Self::Skull(_) => &mut [],
Self::Crafter(c) => &mut c.items,
Self::CreakingHeart(_)
| Self::Spawner(_)
diff --git a/crates/horizon-client/src/dialog.rs b/crates/horizon-client/src/dialog.rs
new file mode 100644
index 000000000..7acd3e86a
--- /dev/null
+++ b/crates/horizon-client/src/dialog.rs
@@ -0,0 +1,794 @@
+//! Server dialogs (`net.minecraft.server.dialog`): what `Dialog.DIRECT_CODEC`
+//! decodes from a `show_dialog` packet, the values its inputs hold, and the
+//! click event an action makes of them (`Action.createAction`).
+use crate::text::Text;
+use horizon_world::nbt::Tag;
+use serde_json::{Value, json};
+
+/// `CommonDialogData` and the type's own fields.
+#[derive(Clone, Debug)]
+pub struct Dialog {
+ pub kind: Kind,
+ pub title: Text,
+ pub external_title: Option,
+ pub can_close_with_escape: bool,
+ pub pause: bool,
+ pub after_action: AfterAction,
+ pub body: Vec,
+ pub inputs: Vec,
+}
+
+/// The dialog types (`DialogTypes`).
+#[derive(Clone, Debug)]
+pub enum Kind {
+ /// `NoticeDialog`: one button, "OK" when the server names none.
+ Notice(Button),
+ Confirmation {
+ yes: Button,
+ no: Button,
+ },
+ MultiAction {
+ actions: Vec