[PR #88] [MERGED] Powder snow: sinking, freezing, leather boots, buckets and falling blocks #2319

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

📋 Pull Request Information

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

Base: main ← Head: fix/powdered-snow-62


📝 Commits (1)

  • 6ce8302 Powder snow: sinking, freezing, leather boots, buckets and falling blocks

📊 Changes

33 files changed (+781 additions, -29 deletions)

View changed files

📝 crates/horizon-client/examples/scene_collision_probe.rs (+1 -0)
📝 crates/horizon-client/examples/scene_motion_probe.rs (+45 -1)
📝 crates/horizon-client/src/advancements.rs (+1 -1)
📝 crates/horizon-client/src/collisions.rs (+20 -5)
📝 crates/horizon-client/src/entities.rs (+2 -0)
📝 crates/horizon-client/src/game.rs (+67 -3)
📝 crates/horizon-client/src/game/advancements.rs (+22 -0)
📝 crates/horizon-client/src/game/armor_stands.rs (+2 -0)
📝 crates/horizon-client/src/game/block_entity_anims.rs (+1 -0)
📝 crates/horizon-client/src/game/boats.rs (+2 -0)
📝 crates/horizon-client/src/game/creatures.rs (+1 -0)
📝 crates/horizon-client/src/game/dispenser.rs (+1 -0)
📝 crates/horizon-client/src/game/fireworks.rs (+1 -0)
📝 crates/horizon-client/src/game/fishing.rs (+1 -0)
📝 crates/horizon-client/src/game/frames.rs (+1 -0)
📝 crates/horizon-client/src/game/minecarts.rs (+1 -0)
📝 crates/horizon-client/src/game/natural_spawning.rs (+1 -0)
📝 crates/horizon-client/src/game/paintings.rs (+1 -0)
📝 crates/horizon-client/src/game/persist.rs (+1 -0)
📝 crates/horizon-client/src/game/perspective.rs (+1 -0)

...and 13 more files

📄 Description

What was wrong

Powder snow did nothing (#62). Horizon had vanilla's contextual collision, but the player's collision context always said "fall distance 0, no boots". Block-inside effects never ran for the player, so nothing made it stuck or froze it. Frozen ticks were a constant 0, the HUD frost overlay was never fed, the empty bucket only took fluids, and falling blocks fell straight through powder snow.

What vanilla does (26.3)

  • PowderSnowBlock.getCollisionShape:
    • empty for an entity sinking in;
    • the whole block for a FallingBlockEntity, or for an entity that canEntityWalkOnPowderSnow (leather boots on the feet, or the walkable mob tag) while above the block and not descending;
    • 0.9 high once fallDistance > 2.5.
  • Entity.applyEffectsFromBlocks / checkInsideBlocks sweep this tick's movement path (BlockGetter.forEachBlockIntersectedBetween, axis-stepped by Direction.axisStepOrder). For every block entered (getEntityInsideCollisionShape), ServerPlayer.onInsideBlock fires ENTER_BLOCK. PowderSnowBlock.entityInside then:
    • calls makeStuckInBlock(0.9, 1.5, 0.9) while the block at the entity's feet is powder snow, which also resets the fall distance;
    • on the server, sends an ALTERNATIVE snowflake from the level random when moving;
    • queues EXTINGUISH (destroying the snow if burning) and FREEZE.
    • InsideBlockEffectApplier.StepBasedCollector applies FREEZE once per sweep step: isInPowderSnow, and +1 frozen tick (capped at 140) when canFreeze.
  • Entity.baseTick moves isInPowderSnow into wasInPowderSnow. With leather boots, LivingEntity.handleRelativeFrictionAndCalculateMovement climbs out (y 0.2) on a horizontal collision or jump.
  • The server freezing phase of LivingEntity.aiStep:
    • thaws by 2 a tick outside snow;
    • removeFrost, then tryAddFrost: a minecraft:powder_snow movement-speed modifier of -0.05 × percentFrozen, unless standing over air;
    • hurtServer(freeze, 1) every 40 ticks when fully frozen.
    • LivingEntity.canFreeze: no spectators, no armor in #freeze_immune_wearables.
  • Gui: the powder snow outline overlay at percentFrozen, frozen hearts when fully frozen.
  • BucketItem.use: PowderSnowBlock.pickupBlock (air, level event 2001), the used statistic, item.bucket.fill_powder_snow, FLUID_PICKUP, ItemUtils.createFilledResult and the filled_bucket trigger.
  • SolidBucketItem: places with item.bucket.empty_powder_snow and gives back an empty bucket in survival.
  • Falling blocks: rest on powder snow, or after a fall of more than 2.5 blocks rest inside the 0.9 shape, where the block they're in isn't replaceable, so they break and drop.

The fix

  • motion.rs (PlayerMotion / MotionWorld):
    • the player's powder-snow collision subject (fall distance, boots);
    • apply_effects_from_blocks with the step grouping, the stuck multiplier, snowflakes and enter_block for every entered block;
    • was/in_powder_snow, ticks_frozen, the frost modifier, freeze damage and can_freeze.
  • collisions.rs: SceneCollisions::subject (PowderSnowSubject), None everywhere else.
  • game/powder_snow.rs: snowflake particles, fire vs powder snow, the bucket pickup.
  • game.rs: boots and freeze immunity each tick, frozen hearts, the solid-bucket placement, falling blocks on powder snow.
  • game/advancements.rs: enter_block (blocks holder set and state), which also gives vanilla's "Remote Getaway" and the boat recipes on entering water.

Tests

  • tools/test_native_scene_motion.py gains powder-snow fixtures. In the new snow_tick operation the oracle runs vanilla's real applyEffectsFromBlocks and freezing phase on its ServerPlayer. The fixtures cover:
    • sinking, crouching and walking in pits, with and without leather boots;
    • falls onto snow;
    • freezing to 140 ticks and beyond with freeze damage;
    • thawing on stone and in the air;
    • walking into and jumping out of a snow column.
  • Every operation also prints the frozen ticks, the snow flags and the stuck multiplier. Result: client and server jars, 1,753,450 evolving states match. The new cases produce 763 snowflakes, 49 freeze hits and 6,343 states with the frost modifier.
  • Two gaps in the stand-in oracle: item components and item tags aren't bound there. Leather boots are a component-less stack, and #freeze_immune_wearables is emulated by them.
  • On the Mac mini, tools/parity.py passed: sprint_input, powder_snow_collision, auto_jump, block_collision_scan, block_landing, camera, collision_context, contextual_collision, entity_collision, fall_damage, first_person, hud, living_fall, living_landing, living_motion, registry_collision_scan, dispenser. After rebasing on the latest main: powder_snow_collision, dispenser, hud, living_motion, first_person and the scene motion harness again.
  • 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:
    • without boots the player sinks to the bottom of a 3-deep pit, and the frost overlay and frozen hearts appear after ~8 s;
    • with leather boots it stays on top;
    • an empty bucket takes the snow, and the powder snow bucket puts it back and returns an empty bucket.

Not covered

  • Mobs: they don't freeze, they don't get stuck in powder snow, and strays don't convert.
  • Cobwebs and sweet berry bushes still don't slow the player; the stuck-multiplier path is now there for them.
  • The player-bucket and falling-block paths have no differential harness; they were checked in game. (The dispenser harness already covers bucket_pickup on powder snow.)
  • enter_block isn't fired for filled cauldrons, end portals and tripwires, whose inside shapes Horizon doesn't model for the player.

Fixes #62

🤖 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/88 **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/powdered-snow-62` --- ### 📝 Commits (1) - [`6ce8302`](https://github.com/horizon-rust/horizon/commit/6ce83021b5e4db7ff30ce964bccd50dfd68e9d3e) Powder snow: sinking, freezing, leather boots, buckets and falling blocks ### 📊 Changes **33 files changed** (+781 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/scene_collision_probe.rs` (+1 -0) 📝 `crates/horizon-client/examples/scene_motion_probe.rs` (+45 -1) 📝 `crates/horizon-client/src/advancements.rs` (+1 -1) 📝 `crates/horizon-client/src/collisions.rs` (+20 -5) 📝 `crates/horizon-client/src/entities.rs` (+2 -0) 📝 `crates/horizon-client/src/game.rs` (+67 -3) 📝 `crates/horizon-client/src/game/advancements.rs` (+22 -0) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+2 -0) 📝 `crates/horizon-client/src/game/block_entity_anims.rs` (+1 -0) 📝 `crates/horizon-client/src/game/boats.rs` (+2 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -0) 📝 `crates/horizon-client/src/game/dispenser.rs` (+1 -0) 📝 `crates/horizon-client/src/game/fireworks.rs` (+1 -0) 📝 `crates/horizon-client/src/game/fishing.rs` (+1 -0) 📝 `crates/horizon-client/src/game/frames.rs` (+1 -0) 📝 `crates/horizon-client/src/game/minecarts.rs` (+1 -0) 📝 `crates/horizon-client/src/game/natural_spawning.rs` (+1 -0) 📝 `crates/horizon-client/src/game/paintings.rs` (+1 -0) 📝 `crates/horizon-client/src/game/persist.rs` (+1 -0) 📝 `crates/horizon-client/src/game/perspective.rs` (+1 -0) _...and 13 more files_ </details> ### 📄 Description ## What was wrong Powder snow did nothing (#62). Horizon had vanilla's contextual collision, but the player's collision context always said "fall distance 0, no boots". Block-inside effects never ran for the player, so nothing made it stuck or froze it. Frozen ticks were a constant 0, the HUD frost overlay was never fed, the empty bucket only took fluids, and falling blocks fell straight through powder snow. ## What vanilla does (26.3) - `PowderSnowBlock.getCollisionShape`: - empty for an entity sinking in; - the whole block for a `FallingBlockEntity`, or for an entity that `canEntityWalkOnPowderSnow` (leather boots on the feet, or the walkable mob tag) while above the block and not descending; - 0.9 high once `fallDistance > 2.5`. - `Entity.applyEffectsFromBlocks` / `checkInsideBlocks` sweep this tick's movement path (`BlockGetter.forEachBlockIntersectedBetween`, axis-stepped by `Direction.axisStepOrder`). For every block entered (`getEntityInsideCollisionShape`), `ServerPlayer.onInsideBlock` fires `ENTER_BLOCK`. `PowderSnowBlock.entityInside` then: - calls `makeStuckInBlock(0.9, 1.5, 0.9)` while the block at the entity's feet is powder snow, which also resets the fall distance; - on the server, sends an ALTERNATIVE snowflake from the level random when moving; - queues EXTINGUISH (destroying the snow if burning) and FREEZE. - `InsideBlockEffectApplier.StepBasedCollector` applies FREEZE once per sweep step: `isInPowderSnow`, and `+1` frozen tick (capped at 140) when `canFreeze`. - `Entity.baseTick` moves `isInPowderSnow` into `wasInPowderSnow`. With leather boots, `LivingEntity.handleRelativeFrictionAndCalculateMovement` climbs out (y 0.2) on a horizontal collision or jump. - The server freezing phase of `LivingEntity.aiStep`: - thaws by 2 a tick outside snow; - `removeFrost`, then `tryAddFrost`: a `minecraft:powder_snow` movement-speed modifier of `-0.05 × percentFrozen`, unless standing over air; - `hurtServer(freeze, 1)` every 40 ticks when fully frozen. - `LivingEntity.canFreeze`: no spectators, no armor in `#freeze_immune_wearables`. - `Gui`: the powder snow outline overlay at `percentFrozen`, frozen hearts when fully frozen. - `BucketItem.use`: `PowderSnowBlock.pickupBlock` (air, level event 2001), the used statistic, `item.bucket.fill_powder_snow`, FLUID_PICKUP, `ItemUtils.createFilledResult` and the filled_bucket trigger. - `SolidBucketItem`: places with `item.bucket.empty_powder_snow` and gives back an empty bucket in survival. - Falling blocks: rest on powder snow, or after a fall of more than 2.5 blocks rest inside the 0.9 shape, where the block they're in isn't replaceable, so they break and drop. ## The fix - `motion.rs` (`PlayerMotion` / `MotionWorld`): - the player's powder-snow collision subject (fall distance, boots); - `apply_effects_from_blocks` with the step grouping, the stuck multiplier, snowflakes and enter_block for every entered block; - `was/in_powder_snow`, `ticks_frozen`, the frost modifier, freeze damage and `can_freeze`. - `collisions.rs`: `SceneCollisions::subject` (`PowderSnowSubject`), None everywhere else. - `game/powder_snow.rs`: snowflake particles, fire vs powder snow, the bucket pickup. - `game.rs`: boots and freeze immunity each tick, frozen hearts, the solid-bucket placement, falling blocks on powder snow. - `game/advancements.rs`: `enter_block` (`blocks` holder set and `state`), which also gives vanilla's "Remote Getaway" and the boat recipes on entering water. ## Tests - `tools/test_native_scene_motion.py` gains powder-snow fixtures. In the new `snow_tick` operation the oracle runs vanilla's real `applyEffectsFromBlocks` and freezing phase on its `ServerPlayer`. The fixtures cover: - sinking, crouching and walking in pits, with and without leather boots; - falls onto snow; - freezing to 140 ticks and beyond with freeze damage; - thawing on stone and in the air; - walking into and jumping out of a snow column. - Every operation also prints the frozen ticks, the snow flags and the stuck multiplier. Result: client and server jars, 1,753,450 evolving states match. The new cases produce 763 snowflakes, 49 freeze hits and 6,343 states with the frost modifier. - Two gaps in the stand-in oracle: item components and item tags aren't bound there. Leather boots are a component-less stack, and `#freeze_immune_wearables` is emulated by them. - On the Mac mini, `tools/parity.py` passed: sprint_input, powder_snow_collision, auto_jump, block_collision_scan, block_landing, camera, collision_context, contextual_collision, entity_collision, fall_damage, first_person, hud, living_fall, living_landing, living_motion, registry_collision_scan, dispenser. After rebasing on the latest main: powder_snow_collision, dispenser, hud, living_motion, first_person and the scene motion harness again. - `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: - without boots the player sinks to the bottom of a 3-deep pit, and the frost overlay and frozen hearts appear after ~8 s; - with leather boots it stays on top; - an empty bucket takes the snow, and the powder snow bucket puts it back and returns an empty bucket. ## Not covered - Mobs: they don't freeze, they don't get stuck in powder snow, and strays don't convert. - Cobwebs and sweet berry bushes still don't slow the player; the stuck-multiplier path is now there for them. - The player-bucket and falling-block paths have no differential harness; they were checked in game. (The dispenser harness already covers `bucket_pickup` on powder snow.) - `enter_block` isn't fired for filled cauldrons, end portals and tripwires, whose inside shapes Horizon doesn't model for the player. Fixes #62 🤖 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:54:55 +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#2319
No description provided.