[PR #4015] [MERGED] Falling sand and gravel ride bubble columns #5357

Closed
opened 2026-11-03 05:12:01 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4015
Author: @d3grando
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix-3393-fallingblock


📝 Commits (1)

  • a18c920 Falling sand and gravel ride bubble columns

📊 Changes

4 files changed (+208 additions, -57 deletions)

View changed files

📝 crates/horizon-client/src/falling_block.rs (+116 -9)
📝 crates/horizon-client/src/game.rs (+31 -15)
📝 crates/horizon-client/src/motion.rs (+4 -1)
📝 crates/horizon-client/src/motion/fluids.rs (+57 -32)

📄 Description

🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves.

What and why

Part of #3393 (its last item: "falling sand/gravel ignore the bubble columns soul sand makes").

Vanilla's FallingBlockEntity.tick calls Entity.applyEffectsFromBlocks after its move, and BubbleColumnBlock.entityInside then lifts or drags the falling block like any other entity. Horizon's fall_step only looked for cobwebs on the path, so sand dropped into a soul sand column sank straight to the bottom (where it popped into an item on the soul sand), and a magma column didn't hold falling blocks back.

The fix:

  • The cobweb sweep in falling_block.rs becomes apply_effects_from_blocks. It visits each block checkInsideBlocks reaches once (vanilla's LongSet), passing vanilla's intersects flag: every block of a move that is a block or longer, otherwise only the blocks the final box is in. Cobwebs still make the block stuck. A bubble column the block intersects now pushes it, and below the surface it also resets the fall distance.
  • motion/fluids.rs: the per-block part of bubble_column_push (finding the column, checking the surface, the push) is split out into bubble_column_at and BubbleColumn::push. Items, mobs and falling blocks now share the same code. Item and mob behaviour doesn't change.
  • fall_step now zeroes velocity on the axes it collided on before applying the block effects, as Entity.move does, so the push isn't thrown away.

Falling blocks use MoveSimulationType.SERVER_AND_CLIENT, so this also applies to the client-side prediction of remote falling blocks (tick_remote_projectiles goes through the same fall_step).

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • FallingBlockEntity.tick: applyGravity, move, applyEffectsFromBlocks, … then deltaMovement * 0.98. getMoveSimulationType returns SERVER_AND_CLIENT.
  • Entity.checkInsideBlocks(Vec3, Vec3, StepBasedCollector, LongSet, int) and its lambda: the deflated box at the end of the movement, intersects = distanceToSqr > Mth.square(0.9999900000002526) || box.intersects(pos), and each block deduplicated through the LongSet.
  • BubbleColumnBlock.entityInside: acts only when intersects; onAboveBubbleColumn when the block above has an empty collision shape and no fluid, else onInsideBubbleColumn.
  • Entity.handleOnAboveBubbleColumn (max(-0.9, y - 0.03) / min(1.8, y + 0.1)) and handleOnInsideBubbleColumn (max(-0.3, y - 0.03) / min(0.7, y + 0.06), then resetFallDistance).
  • BlockBehaviour.getEntityInsideCollisionShape returns Shapes.block() (bubble columns and cobwebs don't override it), so every visited column block counts as collided.

No tools/test_*_parity.py harness covers falling-block movement. The new unit test falling_block::tests::bubble_columns_lift_or_drag_a_falling_block checks the vanilla numbers above. It covers the in-column lift (two blocks, so two pushes), the 0.7 cap, a long fall into the surface block, magma's drag caps at -0.3 and -0.9, a short move out of the column (no push) and a block beside the column.

Self-check

tools/pr_ready.py doesn't run on Windows (it needs SIGHUP), so I ran its steps by hand:

  • cargo fmt --all -- --check: clean
  • cargo clippy -p horizon-client --all-targets -- -D warnings: clean
  • cargo test -p horizon-client --lib falling_block::tests::bubble with the bubble-column arm of apply_effects_from_blocks removed, which is how main behaves: FAILED (panicked at crates\horizon-client\src\falling_block.rs:370:9, velocity stayed at -0.04)
  • the same test with the fix: ok
  • cargo test -p horizon-client --lib falling: 10 passed, 1 ignored (needs HORIZON_TEST_RESOURCES). This includes the existing cobweb test, which now goes through the new sweep.
  • cargo test -p horizon-client --lib motion::: 29 passed
  • cargo test -p horizon-client --lib bubble: 3 passed
  • In game (cargo build --profile fast -p horizon-client --bins, single player with the integrated server on its own thread): a soul sand column and a magma column, 11 blocks deep, in glass, with sand and gravel dropped in from above.
    • Before (v0.2.97 release build; main's fall_step has the same cobweb-only code): the sand sank to the bottom of the soul sand column and broke into an item.
    • After: the sand rises to the surface of the soul sand column and bobs there. After 600 ticks (measured as 645 game ticks between the two time query gametime calls around the drop) it pops as an item, as in vanilla. Gravel in the magma column sinks and lands on the magma.
  • LAN: the host opened the world to LAN and a second game joined as a guest. The guest saw the host's sand float at the top of the soul sand column.

Screenshots

before, 4 s after dropping sand into the two columns: it has sunk out of sight

after, 4 s: the sand rides the soul sand column (right) up to the surface

Before: sand dropped into a soul sand bubble column sinks to the bottom. After: it rides the column up and bobs at the surface; a LAN guest sees the same.

🤖 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/4015 **Author:** [@d3grando](https://github.com/d3grando) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix-3393-fallingblock` --- ### 📝 Commits (1) - [`a18c920`](https://github.com/horizon-rust/horizon/commit/a18c9206d92d61ce401b8f4b6ec6301cf6c9b25e) Falling sand and gravel ride bubble columns ### 📊 Changes **4 files changed** (+208 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/falling_block.rs` (+116 -9) 📝 `crates/horizon-client/src/game.rs` (+31 -15) 📝 `crates/horizon-client/src/motion.rs` (+4 -1) 📝 `crates/horizon-client/src/motion/fluids.rs` (+57 -32) </details> ### 📄 Description > 🤖 Opened by d3grando's AI agent (Claude Code, Claude Opus 5.5), not by d3grando themselves. ## What and why Part of #3393 (its last item: "falling sand/gravel ignore the bubble columns soul sand makes"). Vanilla's `FallingBlockEntity.tick` calls `Entity.applyEffectsFromBlocks` after its move, and `BubbleColumnBlock.entityInside` then lifts or drags the falling block like any other entity. Horizon's `fall_step` only looked for cobwebs on the path, so sand dropped into a soul sand column sank straight to the bottom (where it popped into an item on the soul sand), and a magma column didn't hold falling blocks back. The fix: - The cobweb sweep in `falling_block.rs` becomes `apply_effects_from_blocks`. It visits each block `checkInsideBlocks` reaches once (vanilla's `LongSet`), passing vanilla's `intersects` flag: every block of a move that is a block or longer, otherwise only the blocks the final box is in. Cobwebs still make the block stuck. A bubble column the block intersects now pushes it, and below the surface it also resets the fall distance. - `motion/fluids.rs`: the per-block part of `bubble_column_push` (finding the column, checking the surface, the push) is split out into `bubble_column_at` and `BubbleColumn::push`. Items, mobs and falling blocks now share the same code. Item and mob behaviour doesn't change. - `fall_step` now zeroes velocity on the axes it collided on before applying the block effects, as `Entity.move` does, so the push isn't thrown away. Falling blocks use `MoveSimulationType.SERVER_AND_CLIENT`, so this also applies to the client-side prediction of remote falling blocks (`tick_remote_projectiles` goes through the same `fall_step`). ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `FallingBlockEntity.tick`: `applyGravity`, `move`, `applyEffectsFromBlocks`, … then `deltaMovement * 0.98`. `getMoveSimulationType` returns `SERVER_AND_CLIENT`. - `Entity.checkInsideBlocks(Vec3, Vec3, StepBasedCollector, LongSet, int)` and its lambda: the deflated box at the end of the movement, `intersects = distanceToSqr > Mth.square(0.9999900000002526) || box.intersects(pos)`, and each block deduplicated through the `LongSet`. - `BubbleColumnBlock.entityInside`: acts only when `intersects`; `onAboveBubbleColumn` when the block above has an empty collision shape and no fluid, else `onInsideBubbleColumn`. - `Entity.handleOnAboveBubbleColumn` (`max(-0.9, y - 0.03)` / `min(1.8, y + 0.1)`) and `handleOnInsideBubbleColumn` (`max(-0.3, y - 0.03)` / `min(0.7, y + 0.06)`, then `resetFallDistance`). - `BlockBehaviour.getEntityInsideCollisionShape` returns `Shapes.block()` (bubble columns and cobwebs don't override it), so every visited column block counts as collided. No `tools/test_*_parity.py` harness covers falling-block movement. The new unit test `falling_block::tests::bubble_columns_lift_or_drag_a_falling_block` checks the vanilla numbers above. It covers the in-column lift (two blocks, so two pushes), the 0.7 cap, a long fall into the surface block, magma's drag caps at -0.3 and -0.9, a short move out of the column (no push) and a block beside the column. ## Self-check `tools/pr_ready.py` doesn't run on Windows (it needs SIGHUP), so I ran its steps by hand: - `cargo fmt --all -- --check`: clean - `cargo clippy -p horizon-client --all-targets -- -D warnings`: clean - `cargo test -p horizon-client --lib falling_block::tests::bubble` with the bubble-column arm of `apply_effects_from_blocks` removed, which is how main behaves: **FAILED** (`panicked at crates\horizon-client\src\falling_block.rs:370:9`, velocity stayed at -0.04) - the same test with the fix: **ok** - `cargo test -p horizon-client --lib falling`: 10 passed, 1 ignored (needs `HORIZON_TEST_RESOURCES`). This includes the existing cobweb test, which now goes through the new sweep. - `cargo test -p horizon-client --lib motion::`: 29 passed - `cargo test -p horizon-client --lib bubble`: 3 passed - In game (`cargo build --profile fast -p horizon-client --bins`, single player with the integrated server on its own thread): a soul sand column and a magma column, 11 blocks deep, in glass, with sand and gravel dropped in from above. - Before (v0.2.97 release build; main's `fall_step` has the same cobweb-only code): the sand sank to the bottom of the soul sand column and broke into an item. - After: the sand rises to the surface of the soul sand column and bobs there. After 600 ticks (measured as 645 game ticks between the two `time query gametime` calls around the drop) it pops as an item, as in vanilla. Gravel in the magma column sinks and lands on the magma. - LAN: the host opened the world to LAN and a second game joined as a guest. The guest saw the host's sand float at the top of the soul sand column. ## Screenshots ![before, 4 s after dropping sand into the two columns: it has sunk out of sight](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/3393-fallingblock-1.png) ![after, 4 s: the sand rides the soul sand column (right) up to the surface](https://raw.githubusercontent.com/d3grando/horizon/pr-assets/3393-fallingblock-2.png) Before: sand dropped into a soul sand bubble column sinks to the bottom. After: it rides the column up and bobs at the surface; a LAN guest sees the same. 🤖 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 05:12:01 +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#5357
No description provided.