[PR #112] [MERGED] Cobwebs and sweet berry bushes slow the player #2330

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

📋 Pull Request Information

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

Base: main ← Head: fix/stuck-in-blocks


📝 Commits (1)

  • 39e8bbb Cobwebs and sweet berry bushes slow the player

📊 Changes

6 files changed (+133 additions, -12 deletions)

View changed files

📝 crates/horizon-client/examples/scene_motion_probe.rs (+6 -0)
📝 crates/horizon-client/src/effects.rs (+3 -0)
📝 crates/horizon-client/src/health.rs (+5 -0)
📝 crates/horizon-client/src/motion.rs (+64 -7)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaSceneMotionOracle.java (+9 -4)
📝 tools/test_native_scene_motion.py (+46 -1)

📄 Description

What was wrong

Walking into cobwebs or sweet berry bushes did nothing: the player moved at full speed and grown bushes never pricked. Since #88 the player runs Entity.applyEffectsFromBlocks and has a stuck multiplier, but only powder snow's entityInside was wired to it.

What vanilla does (26.3)

  • WebBlock.entityInside: makeStuckInBlock(state, (0.25, 0.05F, 0.25)), or (0.5, 0.25, 0.5) for a living entity with Weaving.
  • SweetBerryBushBlock.entityInside: for living entities other than foxes and bees, makeStuckInBlock(state, (0.8F, 0.75, 0.8F)); on the server, a bush older than age 0 deals sweetBerryBush damage (1) when the movement (getKnownMovement for client-authoritative players) is at least 0.003 on X or Z.
  • Player.makeStuckInBlock: no fall reset or slowdown while flying; tryResetCurrentImpulseContext either way.
  • Both blocks' inside shape is the whole block (BlockBehaviour.getEntityInsideCollisionShape).

The fix

  • motion.rs: check_inside_blocks dispatches cobwebs and sweet berry bushes as well as powder snow. New make_stuck_in_block follows Player.makeStuckInBlock, and powder snow now goes through it too, so it also respects flying and the impulse reset. web_inside and sweet_berry_bush_inside implement the two entityInside methods, with the berry damage through PlayerMotion::hurt.
  • effects.rs: StatusFlags.weaving.
  • health.rs: a SweetBerryBushDamage event for traces.

Tests

  • tools/test_native_scene_motion.py gains stuck_corpus. Its snow_tick operation runs vanilla's real applyEffectsFromBlocks on the oracle's ServerPlayer. The fixtures cover:
    • cobweb fields with and without Weaving, berry bushes of every age, walking, strafing, jumping and falling into them;
    • long walks through ripe bushes at several health levels (damage cooldown);
    • a web beside a bush and over powder snow;
    • flying through both.
  • The oracle gains weaving (an emulated hasEffect) and flying (abilities) operations, and the sweetBerryBush damage source. Result: client and server, 1,881,193 evolving states match. The new cases produce 2,314 berry-damage hits and thousands of states with each stuck multiplier.
  • tools/parity.py: powder_snow_collision and living_motion pass.
  • cargo clippy --workspace --all-targets -D warnings, cargo test -p horizon-client -p horizon-world and tools/check_public_tree.py pass.
  • On a vscreen, a 1 s walk:
    • covers 4.7 blocks on stone, 1.65 through cobwebs and 2.4 through ripe berry bushes;
    • the bushes take health, which then regenerates.

Not covered

  • Mobs, items and other entities still aren't slowed by cobwebs or berry bushes, and foxes and bees aren't exempted. Only the player runs these block-inside effects; the entity tick paths have no block-inside sweep yet.

🤖 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/112 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/stuck-in-blocks` --- ### 📝 Commits (1) - [`39e8bbb`](https://github.com/horizon-rust/horizon/commit/39e8bbb2f4d81e1046e88e96d5b0c06c4a3bd487) Cobwebs and sweet berry bushes slow the player ### 📊 Changes **6 files changed** (+133 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/scene_motion_probe.rs` (+6 -0) 📝 `crates/horizon-client/src/effects.rs` (+3 -0) 📝 `crates/horizon-client/src/health.rs` (+5 -0) 📝 `crates/horizon-client/src/motion.rs` (+64 -7) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaSceneMotionOracle.java` (+9 -4) 📝 `tools/test_native_scene_motion.py` (+46 -1) </details> ### 📄 Description ## What was wrong Walking into cobwebs or sweet berry bushes did nothing: the player moved at full speed and grown bushes never pricked. Since #88 the player runs `Entity.applyEffectsFromBlocks` and has a stuck multiplier, but only powder snow's `entityInside` was wired to it. ## What vanilla does (26.3) - `WebBlock.entityInside`: `makeStuckInBlock(state, (0.25, 0.05F, 0.25))`, or `(0.5, 0.25, 0.5)` for a living entity with Weaving. - `SweetBerryBushBlock.entityInside`: for living entities other than foxes and bees, `makeStuckInBlock(state, (0.8F, 0.75, 0.8F))`; on the server, a bush older than age 0 deals `sweetBerryBush` damage (1) when the movement (`getKnownMovement` for client-authoritative players) is at least 0.003 on X or Z. - `Player.makeStuckInBlock`: no fall reset or slowdown while flying; `tryResetCurrentImpulseContext` either way. - Both blocks' inside shape is the whole block (`BlockBehaviour.getEntityInsideCollisionShape`). ## The fix - `motion.rs`: `check_inside_blocks` dispatches cobwebs and sweet berry bushes as well as powder snow. New `make_stuck_in_block` follows `Player.makeStuckInBlock`, and powder snow now goes through it too, so it also respects flying and the impulse reset. `web_inside` and `sweet_berry_bush_inside` implement the two `entityInside` methods, with the berry damage through `PlayerMotion::hurt`. - `effects.rs`: `StatusFlags.weaving`. - `health.rs`: a `SweetBerryBushDamage` event for traces. ## Tests - `tools/test_native_scene_motion.py` gains `stuck_corpus`. Its `snow_tick` operation runs vanilla's real `applyEffectsFromBlocks` on the oracle's `ServerPlayer`. The fixtures cover: - cobweb fields with and without Weaving, berry bushes of every age, walking, strafing, jumping and falling into them; - long walks through ripe bushes at several health levels (damage cooldown); - a web beside a bush and over powder snow; - flying through both. - The oracle gains `weaving` (an emulated `hasEffect`) and `flying` (abilities) operations, and the `sweetBerryBush` damage source. Result: client and server, 1,881,193 evolving states match. The new cases produce 2,314 berry-damage hits and thousands of states with each stuck multiplier. - `tools/parity.py`: `powder_snow_collision` and `living_motion` pass. - `cargo clippy --workspace --all-targets -D warnings`, `cargo test -p horizon-client -p horizon-world` and `tools/check_public_tree.py` pass. - On a vscreen, a 1 s walk: - covers 4.7 blocks on stone, 1.65 through cobwebs and 2.4 through ripe berry bushes; - the bushes take health, which then regenerates. ## Not covered - Mobs, items and other entities still aren't slowed by cobwebs or berry bushes, and foxes and bees aren't exempted. Only the player runs these block-inside effects; the entity tick paths have no block-inside sweep yet. 🤖 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-02 15:55:00 +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#2330
No description provided.