[PR #4246] [MERGED] Falling blocks keep their random model offset, so pointed dripstone doesn't jump when it falls #5515

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4246
Author: @DenisHumen
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/falling-block-offset


📝 Commits (1)

  • 0271c62 Falling blocks keep their random model offset (pointed dripstone)

📊 Changes

1 file changed (+60 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+60 -5)

📄 Description

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

What

Falling blocks are now drawn moved by their block's random model offset (BlockState.getOffset). Before this, a pointed dripstone (OffsetType.XZ) that broke off was drawn at the block's centre, so it jumped sideways the moment it started to fall.

The change is a small FallingBlock::model_origin helper used by the falling-block geometry in game.rs. It reuses the mesher's existing offset table, the same one the chunk mesh, breaking cracks and dripstone drip particles already use.

Why (vanilla 26.3)

  • FallingBlockRenderer.extractRenderState: movingBlockRenderState.blockPos = BlockPos.containing(getX(), getBoundingBox().maxY, getZ()), and randomSeedPos = getStartPos().
  • MovingBlockFeatureRenderer → ModelBlockRenderer.tesselateBlock(..., blockPos, state, model, state.getSeed(randomSeedPos)), which starts with Vec3 offset = state.getOffset(blockPos) and adds it to every quad.
  • getOffset for XZ and XYZ depends only on the column (Mth.getSeed(x, 0, z)), so the falling block keeps the offset it had while it hung.

Checked

  • Unit test game::tests::a_falling_block_keeps_its_model_offset: the model corner includes the column's offset, and is centred when the block has no offset.
  • In game (horizon-ctl, Windows, scratch HORIZON_HOME): three tip dripstones hung under stone at y 150, then the stone was removed. I compared screenshots of each dripstone hanging and just after it started to fall:
    • Before (this branch with the offset turned off): the left and right dripstones jump about 20 px towards the block centre when they start to fall.
    • After: they fall straight down from where they hung.
  • cargo test -p horizon-client --bin horizon-client: 207 passed.
  • cargo clippy -p horizon-client --bins --tests -- -D warnings (with the three clippy 1.96 lints allowed): clean.

Not changed here: the falling block still takes its light from one cell (floor(y) + 1), while vanilla lights each face per ModelBlockRenderer. Another DenisHumen agent noted this on the issue; it is a separate change.

Fixes #4102

pr_ready

The two ❌ are unrelated to this diff and are known Windows / clippy 1.96 failures:

  • clippy: manual_range_contains in horizon-world/src/worldgen/aquifer/noise_based.rs:466.
  • tests: title::tests::each_world_preset_writes_its_own_generator fails with "not a directory" on Windows, the same on upstream/main.

Parity harnesses don't run on Windows (fcntl); CI's parity job picks the affected ones.

pr_ready (tools/pr_ready.py --base upstream/main on DenisPC, against upstream/main at fbd7288a1, 4 min 0 s)

Check Result
Scope ✅ 1 files, +60 −5
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 480 passed (1 min 3 s)
rustfmt ✅ (9 s)
clippy ❌ failed (26 s)
tests: horizon-client ❌ 726 passed, 1 failed (2 min 5 s)
doc tests ✅ 0 passed (12 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/4246 **Author:** [@DenisHumen](https://github.com/DenisHumen) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/falling-block-offset` --- ### 📝 Commits (1) - [`0271c62`](https://github.com/horizon-rust/horizon/commit/0271c628250ebedb6b381bcfc485201d3ca7ee60) Falling blocks keep their random model offset (pointed dripstone) ### 📊 Changes **1 file changed** (+60 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+60 -5) </details> ### 📄 Description > 🤖 Opened by DenisHumen's AI agent (Claude Code, Opus 5.5), not by DenisHumen personally. ## What Falling blocks are now drawn moved by their block's random model offset (`BlockState.getOffset`). Before this, a pointed dripstone (`OffsetType.XZ`) that broke off was drawn at the block's centre, so it jumped sideways the moment it started to fall. The change is a small `FallingBlock::model_origin` helper used by the falling-block geometry in `game.rs`. It reuses the mesher's existing `offset` table, the same one the chunk mesh, breaking cracks and dripstone drip particles already use. ## Why (vanilla 26.3) - `FallingBlockRenderer.extractRenderState`: `movingBlockRenderState.blockPos = BlockPos.containing(getX(), getBoundingBox().maxY, getZ())`, and `randomSeedPos = getStartPos()`. - `MovingBlockFeatureRenderer` → `ModelBlockRenderer.tesselateBlock(..., blockPos, state, model, state.getSeed(randomSeedPos))`, which starts with `Vec3 offset = state.getOffset(blockPos)` and adds it to every quad. - `getOffset` for `XZ` and `XYZ` depends only on the column (`Mth.getSeed(x, 0, z)`), so the falling block keeps the offset it had while it hung. ## Checked - Unit test `game::tests::a_falling_block_keeps_its_model_offset`: the model corner includes the column's offset, and is centred when the block has no offset. - In game (`horizon-ctl`, Windows, scratch `HORIZON_HOME`): three tip dripstones hung under stone at y 150, then the stone was removed. I compared screenshots of each dripstone hanging and just after it started to fall: - **Before** (this branch with the offset turned off): the left and right dripstones jump about 20 px towards the block centre when they start to fall. - **After:** they fall straight down from where they hung. - `cargo test -p horizon-client --bin horizon-client`: 207 passed. - `cargo clippy -p horizon-client --bins --tests -- -D warnings` (with the three clippy 1.96 lints allowed): clean. Not changed here: the falling block still takes its light from one cell (`floor(y) + 1`), while vanilla lights each face per `ModelBlockRenderer`. Another DenisHumen agent noted this on the issue; it is a separate change. Fixes #4102 ### pr_ready The two ❌ are unrelated to this diff and are known Windows / clippy 1.96 failures: - clippy: `manual_range_contains` in `horizon-world/src/worldgen/aquifer/noise_based.rs:466`. - tests: `title::tests::each_world_preset_writes_its_own_generator` fails with "not a directory" on Windows, the same on `upstream/main`. Parity harnesses don't run on Windows (`fcntl`); CI's parity job picks the affected ones. **pr_ready** (`tools/pr_ready.py --base upstream/main` on DenisPC, against upstream/main at fbd7288a1, 4 min 0 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +60 −5 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 480 passed (1 min 3 s) | | rustfmt | ✅ (9 s) | | clippy | ❌ failed (26 s) | | tests: horizon-client | ❌ 726 passed, 1 failed (2 min 5 s) | | doc tests | ✅ 0 passed (12 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (no vanilla data here): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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:13:07 +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#5515
No description provided.