[PR #1719] [MERGED] Fix crops remaining after server-side farmland trampling #3713

Closed
opened 2026-11-03 04:11:37 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1719
Author: @rdbtCVS
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: t3/13ed5f77


📝 Commits (4)

  • 753a99b Fix crop updates after server-side farmland trampling
  • 578f077 Merge main and retain both LAN regression checks
  • 3b586ff Server players: one helper finishes a landing's block updates, turtle eggs too
  • fb34815 Merge main into server-farmland-trampling: keep both appended lan_e2e checks

📊 Changes

3 files changed (+93 additions, -29 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+15 -17)
📝 crates/horizon-client/src/game/lan_actions.rs (+9 -12)
📝 tools/lan_e2e.py (+69 -0)

📄 Description

🤖 Opened by rdbt's AI agent (OpenCode, GPT-6.1-sol), not by rdbt himself.

What and why

Fixes #1492.

guest_server_tick kept only hurt sounds from the player's motion events, discarding the FallEvent::Write emitted when landing turns farmland into dirt. The raw block write reached clients, but its missing neighbour-shape update left unsupported wheat in place.

Dispatch the existing write event to notify_written, using its original position and update flags, as the in-frame path already does. The existing block-behaviour and loot code then removes the crop, creates its drops, and synchronizes the result.

Add lan_e2e.py --check farmland: the host and guest each fall onto mature wheat with random ticks disabled. It checks dirt/air on both clients, verifies the authoritative blocks through /execute if block, and checks the normal wheat/seed drops against both server and client inventories.

Vanilla reference

Read the pinned 26.3 server bytecode with tools/rea_vanilla.py:

  • FarmlandBlock.fallOn and turnToBaseBlock: trampling replaces farmland through a normal block update.
  • VegetationBlock.updateShape and CropBlock.canSurvive / mayPlaceOn: an unsupported crop changes to air when its supporting block updates.
  • The prepared vanilla wheat loot table supplies one wheat and 1–4 seeds for a mature crop without Fortune.

The regression was run on real clients using an offscreen Xvfb adapter for the LAN harness:

Run Result
Unfixed build, server-thread host Reproduced: both players leave dirt/wheat, with no crop drops
Fixed build, --server-thread --check farmland Pass: both players leave dirt/air, and drops synchronize
Fixed build, --check farmland (in-frame host) Pass: host and guest both leave dirt/air, and drops synchronize

Self-check

Merged current main to resolve the concurrent LAN-harness additions, retaining both checks. The following self-check and both farmland hosting-path regressions were rerun on the merged head.

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at f2f58aca9, 12 min 19 s)

Check Result
Scope ✅ 2 files, +87 −12
Cargo.lock ✅ unchanged
Public tree ✅ (1 s)
Python tests ✅ 252 passed (39 s)
rustfmt ✅ (15 s)
clippy ✅ (1 min 34 s)
tests: horizon-client ✅ 1201 passed (9 min 16 s)
doc tests ✅ 0 passed (16 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 129 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, locator_bar, mace, marker_particles, mob_ai, online_mode and 117 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Screenshots

Before/after screenshots were captured with horizon-ctl and are included in the associated agent review thread. The unfixed server-thread build shows mature wheat still on dirt after the guest lands; the fixed build shows the crop removed and its drops in the guest's inventory. This contributor token cannot upload attachments to the base repository.

🤖 Generated with OpenCode.


🔄 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/1719 **Author:** [@rdbtCVS](https://github.com/rdbtCVS) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `t3/13ed5f77` --- ### 📝 Commits (4) - [`753a99b`](https://github.com/horizon-rust/horizon/commit/753a99b933605a8c3feea789ba36f333a203d3f7) Fix crop updates after server-side farmland trampling - [`578f077`](https://github.com/horizon-rust/horizon/commit/578f077347f8c527f45ca9b627737e89c39c7b9a) Merge main and retain both LAN regression checks - [`3b586ff`](https://github.com/horizon-rust/horizon/commit/3b586ff9038e97bb475973552edfc31b3a857c7e) Server players: one helper finishes a landing's block updates, turtle eggs too - [`fb34815`](https://github.com/horizon-rust/horizon/commit/fb34815ce187961820bf93eb0f1ea258c390556b) Merge main into server-farmland-trampling: keep both appended lan_e2e checks ### 📊 Changes **3 files changed** (+93 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+15 -17) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+9 -12) 📝 `tools/lan_e2e.py` (+69 -0) </details> ### 📄 Description > 🤖 Opened by rdbt's AI agent (OpenCode, GPT-6.1-sol), not by rdbt himself. ## What and why Fixes #1492. `guest_server_tick` kept only hurt sounds from the player's motion events, discarding the `FallEvent::Write` emitted when landing turns farmland into dirt. The raw block write reached clients, but its missing neighbour-shape update left unsupported wheat in place. Dispatch the existing write event to `notify_written`, using its original position and update flags, as the in-frame path already does. The existing block-behaviour and loot code then removes the crop, creates its drops, and synchronizes the result. Add `lan_e2e.py --check farmland`: the host and guest each fall onto mature wheat with random ticks disabled. It checks dirt/air on both clients, verifies the authoritative blocks through `/execute if block`, and checks the normal wheat/seed drops against both server and client inventories. ## Vanilla reference Read the pinned 26.3 server bytecode with `tools/rea_vanilla.py`: - `FarmlandBlock.fallOn` and `turnToBaseBlock`: trampling replaces farmland through a normal block update. - `VegetationBlock.updateShape` and `CropBlock.canSurvive` / `mayPlaceOn`: an unsupported crop changes to air when its supporting block updates. - The prepared vanilla wheat loot table supplies one wheat and 1–4 seeds for a mature crop without Fortune. The regression was run on real clients using an offscreen Xvfb adapter for the LAN harness: | Run | Result | | --- | --- | | Unfixed build, server-thread host | Reproduced: both players leave dirt/wheat, with no crop drops | | Fixed build, `--server-thread --check farmland` | Pass: both players leave dirt/air, and drops synchronize | | Fixed build, `--check farmland` (in-frame host) | Pass: host and guest both leave dirt/air, and drops synchronize | ## Self-check Merged current main to resolve the concurrent LAN-harness additions, retaining both checks. The following self-check and both farmland hosting-path regressions were rerun on the merged head. **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at f2f58aca9, 12 min 19 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +87 −12 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ (1 s) | | Python tests | ✅ 252 passed (39 s) | | rustfmt | ✅ (15 s) | | clippy | ✅ (1 min 34 s) | | tests: horizon-client | ✅ 1201 passed (9 min 16 s) | | doc tests | ✅ 0 passed (16 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 129 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, locator_bar, mace, marker_particles, mob_ai, online_mode and 117 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Screenshots Before/after screenshots were captured with `horizon-ctl` and are included in the associated agent review thread. The unfixed server-thread build shows mature wheat still on dirt after the guest lands; the fixed build shows the crop removed and its drops in the guest's inventory. This contributor token cannot upload attachments to the base repository. 🤖 Generated with [OpenCode](https://opencode.ai). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:37 +07:00
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#3713
No description provided.