[PR #1915] [MERGED] Big dripleaves tilt under a player standing on them #3862

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1915
Author: @vlesmentie
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/big-dripleaf-tilt


📝 Commits (1)

  • de0f764 Big dripleaves tilt under a player standing on them

📊 Changes

5 files changed (+121 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+31 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+13 -0)
📝 crates/horizon-world/src/level/hooks.rs (+23 -0)
📝 crates/horizon-world/src/level/mod.rs (+13 -0)
📝 crates/horizon-world/src/level/tests.rs (+41 -0)

📄 Description

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

What and why

Fixes #1683.

Standing on a big dripleaf did nothing: the leaf stayed flat and the player never fell through. Most of the block
was already there in horizon-world: big_dripleaf_tick (UNSTABLE → PARTIAL → FULL with the tilt_down sound and
the block_change vibration), big_dripleaf_reset_tilt (back to NONE with tilt_up) and the redstone reset in
neighbor_changed. What was missing is the trigger, BigDripleafBlock.entityInside, so a leaf never left NONE.

  • level/hooks.rs: big_dripleaf_entity_inside(pos, on_ground, feet_y): on a flat, unpowered leaf, an entity that
    canEntityTilt (on the ground, its feet above pos.y + 0.6875) sets it UNSTABLE (flags 2, no sound, no
    vibration: UNSTABLE's causesVibration is false) and schedules the next state in 10 ticks, as
    setTiltAndScheduleTick(UNSTABLE, null).
  • level/mod.rs: Behaviours::entity_on_big_dripleaf, the public entry, next to entity_inside.
  • game.rs (tick_blocks): the inside scan that already feeds entity_inside for plates and tripwires now also
    passes the blocks at the feet layer of the host and the LAN guests (so single player on its server thread too),
    with their feet's y and on-ground flag. game/lan_mobs.rs gives the guests' (lan_guest_feet).

Not in this PR: mobs, items and minecarts standing on a leaf (the scan only covers players for this; minecarts have
no on-ground flag here), and onProjectileHit (an arrow tilting a leaf FULL). Both can follow on the same entry.

Vanilla reference

  • BigDripleafBlock.entityInside: server side, tilt == NONE && canEntityTilt(pos, entity) && !level.hasNeighborSignal(pos) → setTiltAndScheduleTick(state, level, pos, Tilt.UNSTABLE, null)
  • BigDripleafBlock.canEntityTilt: entity.onGround() && entity.position().y > pos.getY() + 0.6875F
  • setTiltAndScheduleTick / setTilt: setBlock(..., 2), BLOCK_CHANGE only when the new tilt causesVibration
    (NONE, PARTIAL, FULL; not UNSTABLE), then scheduleTick after DELAY_UNTIL_NEXT_TILT_STATE (UNSTABLE 10,
    PARTIAL 10, FULL 100)

Checked against the 26.3 client jar's bytecode (javap).

New test level::tests::big_dripleaf_tilts_under_an_entity_standing_on_it (in-memory level, runs with prepared
resources like its neighbours): not on the ground or feet at 0.6875 does nothing; standing on the leaf's top tilts it
UNSTABLE, then PARTIAL after 10 ticks, FULL after 20 and NONE after 120; a tilted leaf doesn't restart; a powered
leaf doesn't tilt. Run here against the launcher's prepared v0.2.55 resources, it passes.

Self-check

pr_ready (tools/pr_ready.py on debian, against origin/main at 7fd1f3118, 4 min 32 s)

Check Result
Scope ✅ 5 files, +121 −0
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (15 s)
clippy ✅ (1 min 18 s)
tests: horizon-client, horizon-world ❌ 1101 passed, 2 failed (2 min 52 s)
doc tests ✅ 0 passed (7 s)
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)

The two failing tests, packs::cache::tests::zip_content_and_failed_build_invalidate and packs::cache::tests::normalized_and_external_overlay_roots_keep_merged_bytes_current, fail the same way on main on this machine and come and go between runs here; CI's verify passes them. They stopped the run before horizon-world's tests, so those ran separately: cargo test -p horizon-world --lib passes (160 passed, 1 ignored).

Not checked in game.

🤖 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/1915 **Author:** [@vlesmentie](https://github.com/vlesmentie) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/big-dripleaf-tilt` --- ### 📝 Commits (1) - [`de0f764`](https://github.com/horizon-rust/horizon/commit/de0f76476f1ee603c7d86d167b669d9680acfdb7) Big dripleaves tilt under a player standing on them ### 📊 Changes **5 files changed** (+121 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+31 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+13 -0) 📝 `crates/horizon-world/src/level/hooks.rs` (+23 -0) 📝 `crates/horizon-world/src/level/mod.rs` (+13 -0) 📝 `crates/horizon-world/src/level/tests.rs` (+41 -0) </details> ### 📄 Description > 🤖 Opened by vlesmentie's AI agent (Claude Code, Claude Opus 5.5), not by vlesmentie themselves. ## What and why Fixes #1683. Standing on a big dripleaf did nothing: the leaf stayed flat and the player never fell through. Most of the block was already there in `horizon-world`: `big_dripleaf_tick` (UNSTABLE → PARTIAL → FULL with the `tilt_down` sound and the `block_change` vibration), `big_dripleaf_reset_tilt` (back to NONE with `tilt_up`) and the redstone reset in `neighbor_changed`. What was missing is the trigger, `BigDripleafBlock.entityInside`, so a leaf never left NONE. - `level/hooks.rs`: `big_dripleaf_entity_inside(pos, on_ground, feet_y)`: on a flat, unpowered leaf, an entity that `canEntityTilt` (on the ground, its feet above `pos.y + 0.6875`) sets it UNSTABLE (flags 2, no sound, no vibration: UNSTABLE's `causesVibration` is false) and schedules the next state in 10 ticks, as `setTiltAndScheduleTick(UNSTABLE, null)`. - `level/mod.rs`: `Behaviours::entity_on_big_dripleaf`, the public entry, next to `entity_inside`. - `game.rs` (`tick_blocks`): the inside scan that already feeds `entity_inside` for plates and tripwires now also passes the blocks at the feet layer of the host and the LAN guests (so single player on its server thread too), with their feet's y and on-ground flag. `game/lan_mobs.rs` gives the guests' (`lan_guest_feet`). Not in this PR: mobs, items and minecarts standing on a leaf (the scan only covers players for this; minecarts have no on-ground flag here), and `onProjectileHit` (an arrow tilting a leaf FULL). Both can follow on the same entry. ## Vanilla reference - `BigDripleafBlock.entityInside`: server side, `tilt == NONE && canEntityTilt(pos, entity) && !level.hasNeighborSignal(pos)` → `setTiltAndScheduleTick(state, level, pos, Tilt.UNSTABLE, null)` - `BigDripleafBlock.canEntityTilt`: `entity.onGround() && entity.position().y > pos.getY() + 0.6875F` - `setTiltAndScheduleTick` / `setTilt`: `setBlock(..., 2)`, `BLOCK_CHANGE` only when the new tilt `causesVibration` (NONE, PARTIAL, FULL; not UNSTABLE), then `scheduleTick` after `DELAY_UNTIL_NEXT_TILT_STATE` (UNSTABLE 10, PARTIAL 10, FULL 100) Checked against the 26.3 client jar's bytecode (`javap`). New test `level::tests::big_dripleaf_tilts_under_an_entity_standing_on_it` (in-memory level, runs with prepared resources like its neighbours): not on the ground or feet at 0.6875 does nothing; standing on the leaf's top tilts it UNSTABLE, then PARTIAL after 10 ticks, FULL after 20 and NONE after 120; a tilted leaf doesn't restart; a powered leaf doesn't tilt. Run here against the launcher's prepared v0.2.55 resources, it passes. ## Self-check **pr_ready** (`tools/pr_ready.py` on debian, against origin/main at 7fd1f3118, 4 min 32 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +121 −0 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (15 s) | | clippy | ✅ (1 min 18 s) | | tests: horizon-client, horizon-world | ❌ 1101 passed, 2 failed (2 min 52 s) | | doc tests | ✅ 0 passed (7 s) | | 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) | The two failing tests, `packs::cache::tests::zip_content_and_failed_build_invalidate` and `packs::cache::tests::normalized_and_external_overlay_roots_keep_merged_bytes_current`, fail the same way on `main` on this machine and come and go between runs here; CI's `verify` passes them. They stopped the run before `horizon-world`'s tests, so those ran separately: `cargo test -p horizon-world --lib` passes (160 passed, 1 ignored). Not checked in game. 🤖 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 04:12:51 +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#3862
No description provided.