[PR #2404] [MERGED] Sulfur cubes bounce, slide and keep speed by their block's archetype #4283

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2404
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/sulfur-cube-archetype-physics


📝 Commits (1)

  • 58a99a2 Sulfur cubes bounce, slide and keep speed by their block's archetype

📊 Changes

2 files changed (+145 additions, -14 deletions)

View changed files

📝 crates/horizon-client/src/mobs/living.rs (+59 -8)
📝 crates/horizon-client/src/mobs/sulfur_cube.rs (+86 -6)

📄 Description

What and why

A sulfur cube holding a block should behave very differently depending on the block: a bouncy one bounces high, a sliding one skids, a light one drifts. In Horizon every cube moved like a plain slime: it stopped dead on landing, used the floor's normal friction and the normal air drag.

The archetype table now also stores the three attribute values each archetype sets (bounciness, friction_modifier, air_drag_modifier), and the shared mob movement uses them:

  • Ground friction is the block's slipperiness changed by the friction modifier.
  • Air drag (horizontal, and vertical when falling) is changed by the air drag modifier.
  • A collision gives back part of the speed instead of zeroing it. Landing needs a hard enough fall to bounce (not just gravity's pull) and never bounces on honey. Block bounciness (slime, beds) is not modelled for mobs and is left as it was.

Other mobs have no such attributes, so they behave exactly as before.

Vanilla reference

  • Entity.restituteMovementAfterCollisions, Entity.getEntityBounciness
  • LivingEntity.travelInAir, LivingEntity.computeModifiedFriction, LivingEntity.getAirDrag
  • SulfurCubeArchetypes.archetype and data/minecraft/sulfur_cube_archetype/*.json

Self-check

cargo check -p horizon-client passes.


🔄 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/2404 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/sulfur-cube-archetype-physics` --- ### 📝 Commits (1) - [`58a99a2`](https://github.com/horizon-rust/horizon/commit/58a99a2ce9b267ccdf210cbdbe26ff551b7fbc3f) Sulfur cubes bounce, slide and keep speed by their block's archetype ### 📊 Changes **2 files changed** (+145 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/living.rs` (+59 -8) 📝 `crates/horizon-client/src/mobs/sulfur_cube.rs` (+86 -6) </details> ### 📄 Description ## What and why A sulfur cube holding a block should behave very differently depending on the block: a bouncy one bounces high, a sliding one skids, a light one drifts. In Horizon every cube moved like a plain slime: it stopped dead on landing, used the floor's normal friction and the normal air drag. The archetype table now also stores the three attribute values each archetype sets (`bounciness`, `friction_modifier`, `air_drag_modifier`), and the shared mob movement uses them: - Ground friction is the block's slipperiness changed by the friction modifier. - Air drag (horizontal, and vertical when falling) is changed by the air drag modifier. - A collision gives back part of the speed instead of zeroing it. Landing needs a hard enough fall to bounce (not just gravity's pull) and never bounces on honey. Block bounciness (slime, beds) is not modelled for mobs and is left as it was. Other mobs have no such attributes, so they behave exactly as before. ## Vanilla reference - `Entity.restituteMovementAfterCollisions`, `Entity.getEntityBounciness` - `LivingEntity.travelInAir`, `LivingEntity.computeModifiedFriction`, `LivingEntity.getAirDrag` - `SulfurCubeArchetypes.archetype` and `data/minecraft/sulfur_cube_archetype/*.json` ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:16:02 +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#4283
No description provided.