[PR #1409] [MERGED] Server players: an axe-disabled shield stays down 5 s, death forgets the digging #3498

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

📋 Pull Request Information

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

Base: main ← Head: fix/server-player-shield-mining


📝 Commits (8)

  • 7acebba Server players: the HUD's bubbles and golden hearts follow the server, absorption is saved, Nether lava pushes harder
  • ed28e1d Contact damage: magma, cactus, lit campfires and sweet berry bushes hurt in both modes
  • 2898b40 Server players: an axe-disabled shield stays down 5 s, death forgets the digging
  • f949f08 Merge remote-tracking branch 'origin/main' into fix/server-air-absorption
  • 10f6b18 Merge branch 'fix/server-air-absorption' into fix/contact-damage
  • 48c1b04 Merge branch 'fix/contact-damage' into fix/server-player-shield-mining
  • 39438ef lan_e2e contacts: sneak before landing on magma, read health before letting go
  • 83db7e3 Merge branch 'fix/contact-damage' into fix/server-player-shield-mining

📊 Changes

13 files changed (+524 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/attribute_updates.rs (+5 -0)
📝 crates/horizon-client/src/game.rs (+4 -2)
📝 crates/horizon-client/src/game/agent.rs (+3 -0)
📝 crates/horizon-client/src/game/lan.rs (+5 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+61 -0)
📝 crates/horizon-client/src/game/remote.rs (+27 -4)
📝 crates/horizon-client/src/lan/guest.rs (+9 -0)
📝 crates/horizon-client/src/lan/hub.rs (+24 -1)
📝 crates/horizon-client/src/lan/playerdata.rs (+7 -0)
📝 crates/horizon-client/src/motion.rs (+72 -3)
📝 crates/horizon-client/src/motion/environment.rs (+1 -1)
📝 crates/horizon-client/src/save.rs (+9 -1)
📝 tools/lan_e2e.py (+297 -1)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

What

  • #1315 A shield disabled by an axe now stays down for 5 s for a server's players. ItemCooldowns ticks once per tick for each player:
    • A server's players count their shield cooldown down in tick_guests.
    • The host's world counts it down in tick_world.
    • Before, the countdown ran in tick_using, which ran for the host and again for every guest's swap, so on the server thread a guest's shield came back early.
  • #1316 A guest that dies stops digging: its mining progress, the delay and the crack are cleared. The block it was breaking no longer breaks once it respawns.

lan status and the agent state now report the shield cooldown.

Fixes #1315, Fixes #1316

How tested

tools/lan_e2e.py adds two checks, both passing in both modes:

  • shield: a vindicator with an iron axe hits each player's raised shield. The server's cooldown starts at 96–99 (at most 100) and falls about 40 in 40 ticks (≈96 → 56).
  • deathmining: the player dies while breaking obsidian and respawns; the obsidian is still there.

On main, deathmining fails in both modes: the obsidian breaks after the respawn (in-frame mode, the guest's; on the server thread, both players'). shield can't run on main because the cooldown isn't reported there.

Left for later (in FEATURES LATER): an axe in PvP doesn't disable a shield, because game/shield.rs only looks attackers up among mobs.

Self-check

One integration commit: origin/main 357dceb9 with all six of this batch's branches merged (hud, contact, guest, spawn, items, knockback; tools/lan_e2e.py taken from the first side where they conflict). tools/pr_ready.py on the Mac mini:

pr_ready (tools/pr_ready.py on ludovics-mac-mini, against origin/main at 357dceb99, 70 min 26 s)

Check Result
Scope ⚠️ 27 files, +1327 −68; 1139 lines of code: over 500, split it if it can ship in parts
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 292 run, FAILED (errors=2) (14 s)
rustfmt ✅ (4 s)
clippy ✅ (25 s)
tests: horizon-client, horizon-world ✅ 1382 passed (3 min 25 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 313 affected, 312 passed, failed: chat_screen (66 min 10 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

chat_screen (1 of 3021 chat screens, the input cursor drawn on one frame) is unrelated to this batch, which touches no chat code: tools/test_chat_screen_parity.py passed twice when rerun on the same tree ("chat screen parity ok").

The Python test errors are the two that fail on main on macOS (test_parity_runner OracleReuse: java exit 127, test_rust_parity: /private/var vs /var paths).

Merging this batch

These PRs are now a chain: #1407 → #1408 → #1409 → #1410 → #1411 → #1412 → #1416 (#1308, beds). #1407 has main merged in, and each later branch merges the one before it (merge commits only), with the tools/lan_e2e.py conflicts resolved: both sides' checks kept, the shared helpers once, and every def checked with the AST against its source branch. Merge them in that order. Until the earlier ones merge, each PR also shows their commits.

On the top branch (#1416), every new check passes in both modes: absorption breath lava contacts shield deathmining worldspawn drops underwater beds minecarts levels. clippy is clean. #1408 also gained a test fix: the contacts sneaking case now sneaks before landing on the magma and reads the health before Shift is released.

What needs Ludovic

Nothing beyond review and merge.

🤖 Generated with Claude Code


🔄 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/1409 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-player-shield-mining` --- ### 📝 Commits (8) - [`7acebba`](https://github.com/horizon-rust/horizon/commit/7acebbae45fb84ec7c905e05f4ac4e4220914d0b) Server players: the HUD's bubbles and golden hearts follow the server, absorption is saved, Nether lava pushes harder - [`ed28e1d`](https://github.com/horizon-rust/horizon/commit/ed28e1dd0d6f6959179ba5f1914cfb69de14d1ae) Contact damage: magma, cactus, lit campfires and sweet berry bushes hurt in both modes - [`2898b40`](https://github.com/horizon-rust/horizon/commit/2898b40670eb253a924560d5edfe8c3a4256a725) Server players: an axe-disabled shield stays down 5 s, death forgets the digging - [`f949f08`](https://github.com/horizon-rust/horizon/commit/f949f08488fc42b3283c20f843c45f604cf09aa0) Merge remote-tracking branch 'origin/main' into fix/server-air-absorption - [`10f6b18`](https://github.com/horizon-rust/horizon/commit/10f6b183e3dcf0fec748c90211b7871c4342e918) Merge branch 'fix/server-air-absorption' into fix/contact-damage - [`48c1b04`](https://github.com/horizon-rust/horizon/commit/48c1b04cb05dc671dbd7b6657e5cf6c6f7f94b26) Merge branch 'fix/contact-damage' into fix/server-player-shield-mining - [`39438ef`](https://github.com/horizon-rust/horizon/commit/39438efd767c09f3b12f202917fccff1de855156) lan_e2e contacts: sneak before landing on magma, read health before letting go - [`83db7e3`](https://github.com/horizon-rust/horizon/commit/83db7e3c41b9567866163101ff78217638e3b1cc) Merge branch 'fix/contact-damage' into fix/server-player-shield-mining ### 📊 Changes **13 files changed** (+524 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/attribute_updates.rs` (+5 -0) 📝 `crates/horizon-client/src/game.rs` (+4 -2) 📝 `crates/horizon-client/src/game/agent.rs` (+3 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+5 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+61 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+27 -4) 📝 `crates/horizon-client/src/lan/guest.rs` (+9 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+24 -1) 📝 `crates/horizon-client/src/lan/playerdata.rs` (+7 -0) 📝 `crates/horizon-client/src/motion.rs` (+72 -3) 📝 `crates/horizon-client/src/motion/environment.rs` (+1 -1) 📝 `crates/horizon-client/src/save.rs` (+9 -1) 📝 `tools/lan_e2e.py` (+297 -1) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What - **#1315** A shield disabled by an axe now stays down for 5 s for a server's players. `ItemCooldowns` ticks once per tick for each player: - A server's players count their shield cooldown down in `tick_guests`. - The host's world counts it down in `tick_world`. - Before, the countdown ran in `tick_using`, which ran for the host and again for every guest's swap, so on the server thread a guest's shield came back early. - **#1316** A guest that dies stops digging: its mining progress, the delay and the crack are cleared. The block it was breaking no longer breaks once it respawns. `lan status` and the agent state now report the shield cooldown. Fixes #1315, Fixes #1316 ## How tested `tools/lan_e2e.py` adds two checks, both passing in both modes: - `shield`: a vindicator with an iron axe hits each player's raised shield. The server's cooldown starts at 96–99 (at most 100) and falls about 40 in 40 ticks (≈96 → 56). - `deathmining`: the player dies while breaking obsidian and respawns; the obsidian is still there. On main, `deathmining` fails in both modes: the obsidian breaks after the respawn (in-frame mode, the guest's; on the server thread, both players'). `shield` can't run on main because the cooldown isn't reported there. Left for later (in FEATURES LATER): an axe in PvP doesn't disable a shield, because `game/shield.rs` only looks attackers up among mobs. ### Self-check One integration commit: origin/main 357dceb9 with all six of this batch's branches merged (hud, contact, guest, spawn, items, knockback; `tools/lan_e2e.py` taken from the first side where they conflict). `tools/pr_ready.py` on the Mac mini: **pr_ready** (`tools/pr_ready.py` on ludovics-mac-mini, against origin/main at 357dceb99, 70 min 26 s) | Check | Result | | --- | --- | | Scope | ⚠️ 27 files, +1327 −68; 1139 lines of code: over 500, split it if it can ship in parts | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 292 run, FAILED (errors=2) (14 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (25 s) | | tests: horizon-client, horizon-world | ✅ 1382 passed (3 min 25 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 313 affected, 312 passed, failed: chat_screen (66 min 10 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | `chat_screen` (1 of 3021 chat screens, the input cursor drawn on one frame) is unrelated to this batch, which touches no chat code: `tools/test_chat_screen_parity.py` passed twice when rerun on the same tree ("chat screen parity ok"). The Python test errors are the two that fail on main on macOS (`test_parity_runner` OracleReuse: java exit 127, `test_rust_parity`: /private/var vs /var paths). ### Merging this batch These PRs are now a chain: #1407 → #1408 → #1409 → #1410 → #1411 → #1412 → #1416 (#1308, beds). #1407 has main merged in, and each later branch merges the one before it (merge commits only), with the `tools/lan_e2e.py` conflicts resolved: both sides' checks kept, the shared helpers once, and every def checked with the AST against its source branch. Merge them in that order. Until the earlier ones merge, each PR also shows their commits. On the top branch (#1416), every new check passes in both modes: `absorption breath lava contacts shield deathmining worldspawn drops underwater beds minecarts levels`. clippy is clean. #1408 also gained a test fix: the `contacts` sneaking case now sneaks before landing on the magma and reads the health before Shift is released. ### What needs Ludovic Nothing beyond review and merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:09:57 +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#3498
No description provided.