[PR #6404] [MERGED] Send mining drops in the tick they are created #6850

Closed
opened 2026-11-03 06:27:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6404
Author: @cristibctr
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: codex/fix-4572-action-latency


📝 Commits (1)

  • 354e2e6 Send player mining drops in the same server tick

📊 Changes

2 files changed (+78 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+11 -3)
📝 tools/lan_e2e.py (+67 -0)

📄 Description

🤖 Opened by cristibctr's AI agent (Codex, GPT-6), not by cristibctr personally.

What and why

Fixes #4572.

Mining and pickups ran after the server collected its block and entity updates. An instant Survival break could therefore create a drop just after that tick's snapshot, leaving clients waiting an extra server tick (50 ms at 20 TPS).

Run guest work before collecting the snapshot. A frozen level also drains its player packets before this work. Paused single-player worlds continue to skip player simulation. This is the shared path for the integrated owner, LAN guests and dedicated-server players.

The new two-client regression queues an instant break behind a server barrier at one TPS. Published Nightly c9d474d fails because neither client receives the drop within 750 ms after release. The patched build passes for both the integrated owner and the LAN guest: arrivals were 15–94 ms. This removes the extra snapshot delay; polling player packets between ticks is a separate change.

Vanilla reference

Read the pinned 26.3 client jar with javap -c -p:

  • ServerPlayerGameMode.handleBlockBreakAction: an instant Survival START destroys the block immediately.
  • MinecraftServer.tickChildren: connection/player work runs before the final connection flush.

Regression: tools/lan_e2e.py --check mining-drop-latency. The port ledger was built from that jar and tools/port_ledger.py check --base origin/main completed.

Self-check

  • Optimized game and control tool builds passed.
  • Six two-client checks passed on the default server-thread path: mining-drop-latency, instant_digging, dig_stop, drops, chest, damage.
  • Formatting and public-tree checks passed.
  • The full check below has unrelated local failures: two unchanged native-hook tests search for LF delimiters in CRLF files (native_breathing_stays_hookable, native_loot_kinds_stay_hookable; the latter already has PR #6375). Clippy reports unchanged code under Rust 1.95.0, older than CI's 1.99.
  • The Python import error is an installed site-packages/tests package shadowing this repository's namespace. The affected test_port_ledger.py passes with python -S -m unittest discover -s tests -p test_port_ledger.py.

pr_ready (tools/pr_ready.py on the-vice, against origin/main at b3c2b6ddd, 6 min 31 s)

Check Result
Scope ✅ 2 files, +75 −3
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 594 run, FAILED (errors=1, skipped=1) (3 min 12 s)
rustfmt ✅ (20 s)
Rust ⚠️ 1.95.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ❌ failed; likely the old Rust above (23 s)
tests: horizon-client ❌ 572 passed, 2 failed (2 min 29 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): 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/6404 **Author:** [@cristibctr](https://github.com/cristibctr) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `codex/fix-4572-action-latency` --- ### 📝 Commits (1) - [`354e2e6`](https://github.com/horizon-rust/horizon/commit/354e2e632d9aea17bb902370849da63cea4ecff5) Send player mining drops in the same server tick ### 📊 Changes **2 files changed** (+78 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+11 -3) 📝 `tools/lan_e2e.py` (+67 -0) </details> ### 📄 Description > 🤖 Opened by cristibctr's AI agent (Codex, GPT-6), not by cristibctr personally. ## What and why Fixes #4572. Mining and pickups ran after the server collected its block and entity updates. An instant Survival break could therefore create a drop just after that tick's snapshot, leaving clients waiting an extra server tick (50 ms at 20 TPS). Run guest work before collecting the snapshot. A frozen level also drains its player packets before this work. Paused single-player worlds continue to skip player simulation. This is the shared path for the integrated owner, LAN guests and dedicated-server players. The new two-client regression queues an instant break behind a server barrier at one TPS. Published Nightly `c9d474d` fails because neither client receives the drop within 750 ms after release. The patched build passes for both the integrated owner and the LAN guest: arrivals were 15–94 ms. This removes the extra snapshot delay; polling player packets between ticks is a separate change. ## Vanilla reference Read the pinned 26.3 client jar with `javap -c -p`: - `ServerPlayerGameMode.handleBlockBreakAction`: an instant Survival START destroys the block immediately. - `MinecraftServer.tickChildren`: connection/player work runs before the final connection flush. Regression: `tools/lan_e2e.py --check mining-drop-latency`. The port ledger was built from that jar and `tools/port_ledger.py check --base origin/main` completed. ## Self-check - Optimized game and control tool builds passed. - Six two-client checks passed on the default server-thread path: `mining-drop-latency`, `instant_digging`, `dig_stop`, `drops`, `chest`, `damage`. - Formatting and public-tree checks passed. - The full check below has unrelated local failures: two unchanged native-hook tests search for LF delimiters in CRLF files (`native_breathing_stays_hookable`, `native_loot_kinds_stay_hookable`; the latter already has PR #6375). Clippy reports unchanged code under Rust 1.95.0, older than CI's 1.99. - The Python import error is an installed `site-packages/tests` package shadowing this repository's namespace. The affected `test_port_ledger.py` passes with `python -S -m unittest discover -s tests -p test_port_ledger.py`. **pr_ready** (`tools/pr_ready.py` on the-vice, against origin/main at b3c2b6ddd, 6 min 31 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +75 −3 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 594 run, FAILED (errors=1, skipped=1) (3 min 12 s) | | rustfmt | ✅ (20 s) | | Rust | ⚠️ 1.95.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ❌ failed; likely the old Rust above (23 s) | | tests: horizon-client | ❌ 572 passed, 2 failed (2 min 29 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): 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>
bsakaguchi 2026-11-03 06:27:59 +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#6850
No description provided.