[PR #7709] Honor the setblock destroy-to-air shortcut #7778

Open
opened 2026-11-03 07:24:03 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7709
Author: @TheMrZZ
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/setblock-destroy-air


📝 Commits (1)

  • 4ca824f Honor the setblock destroy-to-air shortcut

📊 Changes

2 files changed (+92 additions, -10 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+33 -10)
📝 tools/command_exec_corpus.py (+59 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

Fixes #7691. /setblock ... air destroy now succeeds when destruction already leaves air, including an already-air target. The command skips placement when both the requested state and the state after destruction are air. This also preserves Java's exact air variant: destroying stone with cave_air requested leaves normal air. The shortcut still notifies neighbors. Ordinary placement retains the neighbor normalization from #7432.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

Official 26.3 SetBlockCommand.setBlock, Level.destroyBlock, BlockInput.place, and ServerLevel.updateNeighboursOnBlockSet.

The new setblock destroy air group in tools/command_exec_corpus.py compares 123 observations through the existing Java/Horizon command-execution harness: stored success/result scores, styled feedback and callback results, exact air/cave-air/void-air states, setup states, drops, replacement controls, and neighbor notification. The baseline matches 104/123; the fix matches 123/123. A section anchor makes initial air-variant setups valid in both engines; all 13 setup probes and 26 drop probes match even on the baseline.

Separately reran the existing 21 neighbor-normalization cases from #7432 against fresh Java 26.3: 21/21 match. These cover support changes, explicit property overrides, strict mode, normalization before the unchanged-state check, and the fallback when shape updates return air.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick on a local runner, against origin/main at 8dd76f8d4, 3 min 50 s)

Check Result
Scope ✅ 2 files, +92 −10
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (55 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 36 s)
tests: horizon-client ✅ 710 passed (1 min 0 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
mod API up to date ✅ (11 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Codex.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/7709 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/setblock-destroy-air` --- ### 📝 Commits (1) - [`4ca824f`](https://github.com/horizon-rust/horizon/commit/4ca824f84762bf26239fa50e1add9fecf97d474d) Honor the setblock destroy-to-air shortcut ### 📊 Changes **2 files changed** (+92 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+33 -10) 📝 `tools/command_exec_corpus.py` (+59 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why Fixes #7691. `/setblock ... air destroy` now succeeds when destruction already leaves air, including an already-air target. The command skips placement when both the requested state and the state after destruction are air. This also preserves Java's exact air variant: destroying stone with `cave_air` requested leaves normal air. The shortcut still notifies neighbors. Ordinary placement retains the neighbor normalization from #7432. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference Official 26.3 `SetBlockCommand.setBlock`, `Level.destroyBlock`, `BlockInput.place`, and `ServerLevel.updateNeighboursOnBlockSet`. The new `setblock destroy air` group in `tools/command_exec_corpus.py` compares 123 observations through the existing Java/Horizon command-execution harness: stored success/result scores, styled feedback and callback results, exact air/cave-air/void-air states, setup states, drops, replacement controls, and neighbor notification. The baseline matches 104/123; the fix matches 123/123. A section anchor makes initial air-variant setups valid in both engines; all 13 setup probes and 26 drop probes match even on the baseline. Separately reran the existing 21 neighbor-normalization cases from #7432 against fresh Java 26.3: 21/21 match. These cover support changes, explicit property overrides, strict mode, normalization before the unchanged-state check, and the fallback when shape updates return air. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on a local runner, against origin/main at 8dd76f8d4, 3 min 50 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +92 −10 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (55 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 36 s) | | tests: horizon-client | ✅ 710 passed (1 min 0 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (11 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#7778
No description provided.