[PR #772] [MERGED] fix(minecarts): use per-kind display offset in cart geometry (#741) #2798

Closed
opened 2026-11-02 15:59:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/772
Author: @lazy-importer
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: fix/hopper-minecart-display-offset


📝 Commits (1)

  • e92f74f fix(minecarts): use per-kind display offset in cart geometry (#741)

📊 Changes

1 file changed (+20 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/minecarts.rs (+20 -1)

📄 Description

What and why

Fixes #741.

Hopper minecarts were drawing their hopper ~0.23 blocks higher than vanilla because cart_geometry in crates/horizon-client/src/game/minecarts.rs had hardcoded the display block offset translation to (6.0 - 8.0) / 16.0 instead of using the cart kind's display_offset(c.kind).

This change uses (display_offset(c.kind) as f32 - 8.0) / 16.0, which returns offset 1 for hopper minecarts and 6 for all other carts matching vanilla AbstractMinecartRenderer.

Vanilla reference

Follows vanilla AbstractMinecartRenderer.render and MinecartHopper.getDefaultDisplayOffset().

Self-check

Check Result
Scope ✅ 1 file, +20 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅
clippy ✅
tests: horizon-client ✅ passed

🔄 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/772 **Author:** [@lazy-importer](https://github.com/lazy-importer) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/hopper-minecart-display-offset` --- ### 📝 Commits (1) - [`e92f74f`](https://github.com/horizon-rust/horizon/commit/e92f74f01dd53a53938e01b778a5b5868d90c538) fix(minecarts): use per-kind display offset in cart geometry (#741) ### 📊 Changes **1 file changed** (+20 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/minecarts.rs` (+20 -1) </details> ### 📄 Description ## What and why Fixes #741. Hopper minecarts were drawing their hopper ~0.23 blocks higher than vanilla because `cart_geometry` in `crates/horizon-client/src/game/minecarts.rs` had hardcoded the display block offset translation to `(6.0 - 8.0) / 16.0` instead of using the cart kind's `display_offset(c.kind)`. This change uses `(display_offset(c.kind) as f32 - 8.0) / 16.0`, which returns offset 1 for hopper minecarts and 6 for all other carts matching vanilla `AbstractMinecartRenderer`. ## Vanilla reference Follows vanilla `AbstractMinecartRenderer.render` and `MinecartHopper.getDefaultDisplayOffset()`. ## Self-check | Check | Result | | --- | --- | | Scope | ✅ 1 file, +20 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ | | clippy | ✅ | | tests: horizon-client | ✅ passed | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 15:59:08 +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#2798
No description provided.