[PR #6374] [MERGED] Hopper takes a falling item on entry #6834

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6374
Author: @HrafnaValkyrja
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/hopper-item-cycle


📝 Commits (2)

  • 01ba87e Hopper takes a falling item on entry
  • 7a7f5e7 Merge remote-tracking branch 'origin/main' into fix/hopper-item-cycle

📊 Changes

2 files changed (+92 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/machines.rs (+89 -0)

📄 Description

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

What and why

A hopper took an item entity that fell into it one tick later in its cooldown than vanilla, so the first transfer onward came a full cycle behind (3 dirt over a hopper above a chest: vanilla had 2 in the hopper and 1 in the chest at tick 8, Horizon 3 and 0). In vanilla the item is taken in the entity phase, when its move brings it into the hopper's bowl (HopperBlockEntity.entityInside runs tryMoveItems with that item as the pickup); the hopper's own tick, which counts the cooldown down, comes after. Horizon only took the item in the hopper's tick. Now an item that moved this tick and meets the bowl is taken in the same way right after the items tick (eject first if it has items and is not on cooldown, then pickup, cooldown 8 if anything moved).

Changed: game/machines.rs (hoppers_catch_items, hopper_take_item) and one call in game.rs after tick_items (not for guests).

Fixes #6373

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

HopperBlockEntity.entityInside, tryMoveItems with its BooleanSupplier, addItem(Container, ItemEntity), Hopper.INSIDE and the suck shape, level tick order (entities, then block entities).

Test

Side-by-side hopper scene. With the call reverted (file copy) the hopper-over-item rows differ at ticks 8 and 16 again (4 values); with it they match. There is no unit test: the path needs a running game with hoppers and items.

Numbers

Hopper facing down onto a chest, 3 dirt items above (hopper / chest), vanilla / before / after:

tick 8 tick 16
items 2 / 1 1 / 2
Horizon before 3 / 0 2 / 1
Horizon after 2 / 1 1 / 2

Scene 210 -> 214 of 230 values equal.

What wasn't compared

  • Remaining differences in the scene: TransferCooldown is not exposed by data get on Horizon, and the composter level (random).
  • An item resting in the bowl that does not move on a given tick is still taken by the hopper's own tick, as before; items blocked in place on a tick whose move was skipped by the 1-in-4 rule are approximated.
  • Hopper minecarts, droppers feeding items and dispenser timing were not changed.

Proved by script against the real 26.3 server; no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at 8101f23df, 2 min 59 s)

Check Result
Scope ✅ 3 files, +92 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 594 passed (26 s)
rustfmt ✅ (6 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅ (1 min 17 s)
tests: horizon-client ✅ 575 passed (1 min 7 s)
doc tests ✅ 0 passed (1 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 ➖ 330 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_particles, block_removal, boat_authority, boat_paddle_reset, boat_submerged, breaking_model, bulk_section, bundle_weight, camera and 318 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/6374 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/hopper-item-cycle` --- ### 📝 Commits (2) - [`01ba87e`](https://github.com/horizon-rust/horizon/commit/01ba87ebc2d68eb44d7201a7454a49822ca1f234) Hopper takes a falling item on entry - [`7a7f5e7`](https://github.com/horizon-rust/horizon/commit/7a7f5e7ba1ebfc16c253ee8aed66db6b7bc179fa) Merge remote-tracking branch 'origin/main' into fix/hopper-item-cycle ### 📊 Changes **2 files changed** (+92 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/machines.rs` (+89 -0) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why A hopper took an item entity that fell into it one tick later in its cooldown than vanilla, so the first transfer onward came a full cycle behind (3 dirt over a hopper above a chest: vanilla had 2 in the hopper and 1 in the chest at tick 8, Horizon 3 and 0). In vanilla the item is taken in the entity phase, when its move brings it into the hopper's bowl (`HopperBlockEntity.entityInside` runs `tryMoveItems` with that item as the pickup); the hopper's own tick, which counts the cooldown down, comes after. Horizon only took the item in the hopper's tick. Now an item that moved this tick and meets the bowl is taken in the same way right after the items tick (eject first if it has items and is not on cooldown, then pickup, cooldown 8 if anything moved). Changed: `game/machines.rs` (`hoppers_catch_items`, `hopper_take_item`) and one call in `game.rs` after `tick_items` (not for guests). Fixes #6373 ## 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 `HopperBlockEntity.entityInside`, `tryMoveItems` with its `BooleanSupplier`, `addItem(Container, ItemEntity)`, `Hopper.INSIDE` and the suck shape, level tick order (entities, then block entities). ## Test Side-by-side `hopper` scene. With the call reverted (file copy) the hopper-over-item rows differ at ticks 8 and 16 again (4 values); with it they match. There is no unit test: the path needs a running game with hoppers and items. ## Numbers Hopper facing down onto a chest, 3 dirt items above (hopper / chest), vanilla / before / after: | | tick 8 | tick 16 | |---|---|---| | items | 2 / 1 | 1 / 2 | | Horizon before | 3 / 0 | 2 / 1 | | Horizon after | 2 / 1 | 1 / 2 | Scene 210 -> 214 of 230 values equal. ## What wasn't compared - Remaining differences in the scene: `TransferCooldown` is not exposed by `data get` on Horizon, and the composter level (random). - An item resting in the bowl that does not move on a given tick is still taken by the hopper's own tick, as before; items blocked in place on a tick whose move was skipped by the 1-in-4 rule are approximated. - Hopper minecarts, droppers feeding items and dispenser timing were not changed. Proved by script against the real 26.3 server; no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at 8101f23df, 2 min 59 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +92 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 594 passed (26 s) | | rustfmt | ✅ (6 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ (1 min 17 s) | | tests: horizon-client | ✅ 575 passed (1 min 7 s) | | doc tests | ✅ 0 passed (1 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 | ➖ 330 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, block_particles, block_removal, boat_authority, boat_paddle_reset, boat_submerged, breaking_model, bulk_section, bundle_weight, camera and 318 more | | 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) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:27:44 +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#6834
No description provided.