[PR #5318] [MERGED] Paintings, item frames and cushions ignore a blast whose source is in water #6206

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

📋 Pull Request Information

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

Base: main ← Head: fix/blast-in-water-spares-decorations


📝 Commits (3)

  • c24000a A blast whose source is in water spares paintings, item frames and cushions
  • 551eb26 Merge main into #5318 (main's Python tests pass again after #5369)
  • c6af9eb Merge main into #5318 (sulfur_cube.rs beside #5317)

📊 Changes

12 files changed (+103 additions, -28 deletions)

View changed files

📝 crates/horizon-client/src/game/combat.rs (+4 -0)
📝 crates/horizon-client/src/game/creatures.rs (+10 -1)
📝 crates/horizon-client/src/game/dragon.rs (+7 -0)
📝 crates/horizon-client/src/game/explosion.rs (+66 -23)
📝 crates/horizon-client/src/game/frames.rs (+0 -2)
📝 crates/horizon-client/src/game/minecarts.rs (+2 -0)
📝 crates/horizon-client/src/game/tnt.rs (+7 -2)
📝 crates/horizon-client/src/game/wither.rs (+2 -0)
📝 crates/horizon-client/src/mobs.rs (+2 -0)
📝 crates/horizon-client/src/mobs/hostile.rs (+1 -0)
📝 crates/horizon-client/src/mobs/sulfur_cube.rs (+1 -0)
📝 crates/horizon-client/src/mobs/wither.rs (+1 -0)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Part of #3514: the BlockAttachedEntity.ignoreExplosion row. sirrayi listed it as waiting for the vanilla source; this is the source (BlockAttachedEntity.java:114, ServerExplosion.java:183).

Vanilla

public boolean ignoreExplosion(final Explosion explosion) {
   Entity directEntity = explosion.getDirectSourceEntity();
   if (directEntity != null && directEntity.isInWater()) {
      return true;
   } else {
      return explosion.shouldAffectBlocklikeEntities() ? super.ignoreExplosion(explosion) : true;
   }
}

ServerExplosion.hurtEntities skips an entity whose ignoreExplosion is true. So paintings, item frames and cushions (the BlockAttachedEntitys) are untouched by a blast whose direct source is in water, whatever the rules; the shouldAffectBlocklikeEntities half (mobGriefing, wind charges) was already ported.

What changes

  • Game::bounds_in_water is Entity.isInWater for an entity box (updateFluidInteraction over the box, as projectiles already do).
  • The blast's direct source reports it: primed TNT, TNT minecarts, creepers, sulfur cubes and withers (MobEvent::ExplosionSource::in_water), large fireballs and wither skulls (touching_water), end crystals (their 2 by 2 box).
  • blast_spares_decorations takes source_in_water; paintings, item frames and cushions use it. Armour stands are not BlockAttachedEntitys, so they keep their own rule (the helper is called with false for them).

Verification

  • mob_griefing_off_spares_decorations_from_kept_and_mob_blasts has the water cases and the unchanged ones.
  • pr_ready --quick: clippy and rustfmt pass. The only failures are the 8 lan_bot tests and one test_perf_bench Python test, which fail the same way on a clean origin/main here.
  • I did not get an in-game capture: the item frames I summoned were not selectable or drawn in the offscreen run, so I could not show them breaking or surviving.

🤖 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/5318 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/blast-in-water-spares-decorations` --- ### 📝 Commits (3) - [`c24000a`](https://github.com/horizon-rust/horizon/commit/c24000a4ab091ebb49bd6b8fa2e8f86bc0278dab) A blast whose source is in water spares paintings, item frames and cushions - [`551eb26`](https://github.com/horizon-rust/horizon/commit/551eb26680ff99aa967823b15688bae12697e0d6) Merge main into #5318 (main's Python tests pass again after #5369) - [`c6af9eb`](https://github.com/horizon-rust/horizon/commit/c6af9ebb1fab784d77bd9721248e2903dfb8c195) Merge main into #5318 (sulfur_cube.rs beside #5317) ### 📊 Changes **12 files changed** (+103 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/combat.rs` (+4 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+10 -1) 📝 `crates/horizon-client/src/game/dragon.rs` (+7 -0) 📝 `crates/horizon-client/src/game/explosion.rs` (+66 -23) 📝 `crates/horizon-client/src/game/frames.rs` (+0 -2) 📝 `crates/horizon-client/src/game/minecarts.rs` (+2 -0) 📝 `crates/horizon-client/src/game/tnt.rs` (+7 -2) 📝 `crates/horizon-client/src/game/wither.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs.rs` (+2 -0) 📝 `crates/horizon-client/src/mobs/hostile.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs/sulfur_cube.rs` (+1 -0) 📝 `crates/horizon-client/src/mobs/wither.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Part of #3514: the `BlockAttachedEntity.ignoreExplosion` row. `sirrayi` listed it as waiting for the vanilla source; this is the source (`BlockAttachedEntity.java:114`, `ServerExplosion.java:183`). ## Vanilla ```java public boolean ignoreExplosion(final Explosion explosion) { Entity directEntity = explosion.getDirectSourceEntity(); if (directEntity != null && directEntity.isInWater()) { return true; } else { return explosion.shouldAffectBlocklikeEntities() ? super.ignoreExplosion(explosion) : true; } } ``` `ServerExplosion.hurtEntities` skips an entity whose `ignoreExplosion` is true. So paintings, item frames and cushions (the `BlockAttachedEntity`s) are untouched by a blast whose direct source is in water, whatever the rules; the `shouldAffectBlocklikeEntities` half (mobGriefing, wind charges) was already ported. ## What changes - `Game::bounds_in_water` is `Entity.isInWater` for an entity box (`updateFluidInteraction` over the box, as projectiles already do). - The blast's direct source reports it: primed TNT, TNT minecarts, creepers, sulfur cubes and withers (`MobEvent::ExplosionSource::in_water`), large fireballs and wither skulls (`touching_water`), end crystals (their 2 by 2 box). - `blast_spares_decorations` takes `source_in_water`; paintings, item frames and cushions use it. Armour stands are not `BlockAttachedEntity`s, so they keep their own rule (the helper is called with `false` for them). ## Verification - `mob_griefing_off_spares_decorations_from_kept_and_mob_blasts` has the water cases and the unchanged ones. - `pr_ready --quick`: clippy and rustfmt pass. The only failures are the 8 `lan_bot` tests and one `test_perf_bench` Python test, which fail the same way on a clean `origin/main` here. - I did not get an in-game capture: the item frames I summoned were not selectable or drawn in the offscreen run, so I could not show them breaking or surviving. 🤖 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 06:15:51 +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#6206
No description provided.