[PR #5283] [MERGED] Draw no falling block that sits inside its own state #6185

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

📋 Pull Request Information

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

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


📝 Commits (1)

  • baaf6b5 Draw no falling block that sits inside its own state

📊 Changes

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

View changed files

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

📄 Description

Fixes the FallingBlockRenderer.shouldRender row in the port ledger. (No issue.)

Vanilla does not draw a falling block whose own state is the state of the cell it occupies — entity.getBlockState() != entity.level().getBlockState(entity.blockPosition()). That is exactly the case of a NoGravity block holding still inside a block of its own kind, or one that has just landed: Horizon drew it every frame, leaving a duplicate that z-fights with the block around it.

One predicate and one continue, with the cell computed once and reused by the light read that was already there.

Proven: cargo test -p horizon-client --bin horizon-client a_falling_block → 2 passed on a build box against the current main, the existing model-offset test plus the new one (a block whose state equals its cell is drawn by nothing; the same block with the cell cleared draws again). Not proven: the pixels — the honest check is /summon minecraft:falling_block ~ ~ ~ {BlockState:{Name:"minecraft:sand"},NoGravity:1b} inside a sand block, which shows one sand block in vanilla and two fighting in Horizon before this.

The predicate is a free function rather than an inline && because the draw pass is Game::entity_geometry and cannot be unit-tested; the existing falling-block test pins model_origin for the same reason. The inherited half of shouldRender (distance, frustum, leash) is Horizon's own entity culler and is untouched, as is the other submit guard (a block with no model already skips).


🔄 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/5283 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/falling-block-hidden` --- ### 📝 Commits (1) - [`baaf6b5`](https://github.com/horizon-rust/horizon/commit/baaf6b5d4ed70745b0ebf63bd5da823d65af8d10) Draw no falling block that sits inside its own state ### 📊 Changes **1 file changed** (+30 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+30 -5) </details> ### 📄 Description Fixes the `FallingBlockRenderer.shouldRender` row in the port ledger. (No issue.) Vanilla does not draw a falling block whose own state is the state of the cell it occupies — `entity.getBlockState() != entity.level().getBlockState(entity.blockPosition())`. That is exactly the case of a `NoGravity` block holding still inside a block of its own kind, or one that has just landed: Horizon drew it every frame, leaving a duplicate that z-fights with the block around it. One predicate and one `continue`, with the cell computed once and reused by the light read that was already there. **Proven:** `cargo test -p horizon-client --bin horizon-client a_falling_block` → 2 passed on a build box against the current `main`, the existing model-offset test plus the new one (a block whose state equals its cell is drawn by nothing; the same block with the cell cleared draws again). **Not proven:** the pixels — the honest check is `/summon minecraft:falling_block ~ ~ ~ {BlockState:{Name:"minecraft:sand"},NoGravity:1b}` inside a sand block, which shows one sand block in vanilla and two fighting in Horizon before this. The predicate is a free function rather than an inline `&&` because the draw pass is `Game::entity_geometry` and cannot be unit-tested; the existing falling-block test pins `model_origin` for the same reason. The inherited half of `shouldRender` (distance, frustum, leash) is Horizon's own entity culler and is untouched, as is the other submit guard (a block with no model already skips). --- <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:39 +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#6185
No description provided.