[PR #1408] [MERGED] Contact damage: magma, cactus, lit campfires and sweet berry bushes hurt a server's players #3497

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/1408
Author: @ludovic111
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @ludovic111

Base: main ← Head: fix/contact-damage


📝 Commits (5)

  • 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
  • f949f08 Merge remote-tracking branch 'origin/main' into fix/server-air-absorption
  • 10f6b18 Merge branch 'fix/server-air-absorption' into fix/contact-damage
  • 39438ef lan_e2e contacts: sneak before landing on magma, read health before letting go

📊 Changes

13 files changed (+372 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/attribute_updates.rs (+5 -0)
📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/agent.rs (+2 -0)
📝 crates/horizon-client/src/game/lan.rs (+3 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+31 -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 (+181 -2)

📄 Description

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

What

Contact damage now works for a server's players: the host on the server thread and LAN guests.

  • #1305 Magma hurts a player who is not sneaking (MagmaBlock.stepOn, hot_floor, 1).
  • #1311 Cactus hurts (CactusBlock.entityInside, 1).
  • #1312 A lit campfire hurts (1), and a lit soul campfire hurts more (2).
  • #1313 A grown sweet berry bush pricks.

Fixes #1305, Fixes #1311, Fixes #1312, Fixes #1313

Why

A server's players move on their own clients. The server never ran Entity.applyEffectsFromBlocks along their moves, so no block damaged them.

How

The server rebuilds the movement history for that tick from the moves the client sent, then runs the damage half of the block effects on it (server_block_damage in motion.rs).

How tested

tools/lan_e2e.py contacts covers magma, sneaking on magma, a lit campfire, a cactus, and grown and young berry bushes, for both the host and the guest. It passes in both modes.

The same check fails on main: no damage at all in either mode (magma, campfire and cactus all leave health at 20 → 20).

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/1408 **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/contact-damage` --- ### 📝 Commits (5) - [`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 - [`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 - [`39438ef`](https://github.com/horizon-rust/horizon/commit/39438efd767c09f3b12f202917fccff1de855156) lan_e2e contacts: sneak before landing on magma, read health before letting go ### 📊 Changes **13 files changed** (+372 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/attribute_updates.rs` (+5 -0) 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/agent.rs` (+2 -0) 📝 `crates/horizon-client/src/game/lan.rs` (+3 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+31 -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` (+181 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What Contact damage now works for a server's players: the host on the server thread and LAN guests. - **#1305** Magma hurts a player who is not sneaking (`MagmaBlock.stepOn`, hot_floor, 1). - **#1311** Cactus hurts (`CactusBlock.entityInside`, 1). - **#1312** A lit campfire hurts (1), and a lit soul campfire hurts more (2). - **#1313** A grown sweet berry bush pricks. Fixes #1305, Fixes #1311, Fixes #1312, Fixes #1313 ## Why A server's players move on their own clients. The server never ran `Entity.applyEffectsFromBlocks` along their moves, so no block damaged them. ## How The server rebuilds the movement history for that tick from the moves the client sent, then runs the damage half of the block effects on it (`server_block_damage` in `motion.rs`). ## How tested `tools/lan_e2e.py contacts` covers magma, sneaking on magma, a lit campfire, a cactus, and grown and young berry bushes, for both the host and the guest. It passes in both modes. The same check fails on main: no damage at all in either mode (magma, campfire and cactus all leave health at 20 → 20). ### 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#3497
No description provided.