[PR #1752] [MERGED] Fix End crystal attacks from connected clients #3741

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

📋 Pull Request Information

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

Base: main ← Head: t3/fix-end-crystal-attack


📝 Commits (2)

  • 9409d2c Multiplayer: allow punching End crystals
  • d6cc631 Merge main into the End crystal attack branch

📊 Changes

3 files changed (+113 additions, -7 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+3 -3)
📝 crates/horizon-client/src/game/remote_vehicles.rs (+20 -4)
📝 tools/lan_e2e.py (+90 -0)

📄 Description

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

What and why

Fixes #1532.

  • Include End crystals in the connected client's nearest-object attack hit-test, using their 2×2 bounding boxes and actual network entity IDs.
  • Send the existing attack packet so the server handles the crystal's explosion and player damage.
  • Let right-clicks on crystals fall through to held-item use.

Vanilla reference

Checked the pinned Minecraft Java 26.3 methods with tools/rea_vanilla.py:

  • EndCrystal.isPickable: crystals are pickable entities.
  • MultiPlayerGameMode.attack: sends ServerboundAttackPacket(entity.getId()).
  • EndCrystal.hurtServer: destroys the crystal and causes a power-6 explosion.
  • Entity.interact: a crystal's interaction passes, allowing item use.

Regression check

Extended tools/lan_e2e.py with a real-mouse crystals check:

python3 tools/lan_e2e.py --server-thread --check crystals
python3 tools/lan_e2e.py --check crystals

Both commands passed on the rebased branch, run offscreen under a disposable Xvfb with scratch game homes. Each covers the host and LAN guest in survival and creative: all eight cases detonate the crystal on one ordinary left-click. Creative players retain 20 health; unprotected survival players die from the close explosion. The check also verifies out-of-reach attacks, block occlusion, shared network IDs, and raising a shield with right-click while aiming at the crystal.

The check reproduced the original failure before the fix: a connected client's punch left the crystal intact on both sides.

Self-check

pr_ready (tools/pr_ready.py --quick on archlinux, against origin/main at 4a675206b, 5 min 46 s)

Check Result
Scope ✅ 3 files, +114 −8
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 257 passed (23 s)
rustfmt ✅ (5 s)
clippy ✅ (22 s)
tests: horizon-client ✅ 1201 passed (4 min 45 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 ➖ 26 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, interaction_input, locator_bar, mace, online_mode, player_sync and 14 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 for both players and modes in .local/end-crystal-server-thread-e2e/ and .local/end-crystal-in-frame-e2e/. The regression check emits them as {host,guest}-crystals-{creative,survival}-{before,after}.png.

🤖 Generated with OpenCode (GPT-6.1).


🔄 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/1752 **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/fix-end-crystal-attack` --- ### 📝 Commits (2) - [`9409d2c`](https://github.com/horizon-rust/horizon/commit/9409d2c19b2ab10ad1e00697ab3e0aa7f2a0de2d) Multiplayer: allow punching End crystals - [`d6cc631`](https://github.com/horizon-rust/horizon/commit/d6cc63173589f576e47ffd863a66f3250625ebdc) Merge main into the End crystal attack branch ### 📊 Changes **3 files changed** (+113 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+3 -3) 📝 `crates/horizon-client/src/game/remote_vehicles.rs` (+20 -4) 📝 `tools/lan_e2e.py` (+90 -0) </details> ### 📄 Description > 🤖 Opened by rdbt's AI agent (OpenCode, GPT-6.1), not by rdbt himself. ## What and why Fixes #1532. - Include End crystals in the connected client's nearest-object attack hit-test, using their 2×2 bounding boxes and actual network entity IDs. - Send the existing attack packet so the server handles the crystal's explosion and player damage. - Let right-clicks on crystals fall through to held-item use. ## Vanilla reference Checked the pinned Minecraft Java 26.3 methods with `tools/rea_vanilla.py`: - `EndCrystal.isPickable`: crystals are pickable entities. - `MultiPlayerGameMode.attack`: sends `ServerboundAttackPacket(entity.getId())`. - `EndCrystal.hurtServer`: destroys the crystal and causes a power-6 explosion. - `Entity.interact`: a crystal's interaction passes, allowing item use. ## Regression check Extended `tools/lan_e2e.py` with a real-mouse `crystals` check: ```sh python3 tools/lan_e2e.py --server-thread --check crystals python3 tools/lan_e2e.py --check crystals ``` Both commands passed on the rebased branch, run offscreen under a disposable Xvfb with scratch game homes. Each covers the host and LAN guest in survival and creative: all eight cases detonate the crystal on one ordinary left-click. Creative players retain 20 health; unprotected survival players die from the close explosion. The check also verifies out-of-reach attacks, block occlusion, shared network IDs, and raising a shield with right-click while aiming at the crystal. The check reproduced the original failure before the fix: a connected client's punch left the crystal intact on both sides. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on archlinux, against origin/main at 4a675206b, 5 min 46 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +114 −8 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 257 passed (23 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (22 s) | | tests: horizon-client | ✅ 1201 passed (4 min 45 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 | ➖ 26 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, dedicated_server, dispenser, interaction_input, locator_bar, mace, online_mode, player_sync and 14 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 for both players and modes in `.local/end-crystal-server-thread-e2e/` and `.local/end-crystal-in-frame-e2e/`. The regression check emits them as `{host,guest}-crystals-{creative,survival}-{before,after}.png`. 🤖 Generated with [OpenCode](https://opencode.ai) (GPT-6.1). --- <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: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#3741
No description provided.